Warn on %{+undef} and @{+undef}
Chip Salzenberg [Thu, 6 Mar 1997 15:46:37 +0000 (03:46 +1200)]
pp.c
pp_hot.c

diff --git a/pp.c b/pp.c
index 59a6ea7..863478d 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -139,6 +139,8 @@ PP(pp_rv2gv)
                if (op->op_flags & OPf_REF ||
                    op->op_private & HINT_STRICT_REFS)
                    DIE(no_usym, "a symbol");
+               if (dowarn)
+                   warn(warn_uninit);
                RETSETUNDEF;
            }
            sym = SvPV(sv, na);
@@ -181,6 +183,8 @@ PP(pp_rv2sv)
                if (op->op_flags & OPf_REF ||
                    op->op_private & HINT_STRICT_REFS)
                    DIE(no_usym, "a SCALAR");
+               if (dowarn)
+                   warn(warn_uninit);
                RETSETUNDEF;
            }
            sym = SvPV(sv, na);
index f2864c0..d9a4f07 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -412,7 +412,6 @@ PP(pp_print)
 PP(pp_rv2av)
 {
     dSP; dPOPss;
-
     AV *av;
 
     if (SvROK(sv)) {
@@ -450,6 +449,8 @@ PP(pp_rv2av)
                    if (op->op_flags & OPf_REF ||
                      op->op_private & HINT_STRICT_REFS)
                        DIE(no_usym, "an ARRAY");
+                   if (dowarn)
+                       warn(warn_uninit);
                    if (GIMME == G_ARRAY)
                        RETURN;
                    RETPUSHUNDEF;
@@ -487,9 +488,7 @@ PP(pp_rv2av)
 
 PP(pp_rv2hv)
 {
-
     dSP; dTOPss;
-
     HV *hv;
 
     if (SvROK(sv)) {
@@ -527,6 +526,8 @@ PP(pp_rv2hv)
                    if (op->op_flags & OPf_REF ||
                      op->op_private & HINT_STRICT_REFS)
                        DIE(no_usym, "a HASH");
+                   if (dowarn)
+                       warn(warn_uninit);
                    if (GIMME == G_ARRAY) {
                        SP--;
                        RETURN;