exempt $foo::a,$foo::b from warnings only if sort() was seen in package foo
Graham Barr [Wed, 3 Mar 1999 17:23:56 +0000 (11:23 -0600)]
Message-ID: <19990303172356.F7442@dal.asp.ti.com>
Subject: Re: 'use strict' doesn't work for one-letter variables

p4raw-id: //depot/perl@3067

gv.c
op.c

diff --git a/gv.c b/gv.c
index ff278cc..ae77d28 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -621,12 +621,6 @@ gv_fetchpv(const char *nambeg, I32 add, I32 sv_type)
            IoFLAGS(GvIOn(gv)) |= IOf_ARGV|IOf_START;
        }
        break;
-
-    case 'a':
-    case 'b':
-       if (len == 1)
-           GvMULTI_on(gv);
-       break;
     case 'E':
        if (strnEQ(name, "EXPORT", 6))
            GvMULTI_on(gv);
diff --git a/op.c b/op.c
index fae524e..560a50e 100644 (file)
--- a/op.c
+++ b/op.c
@@ -5110,6 +5110,11 @@ ck_sort(OP *o)
        o->op_private |= OPpLOCALE;
 #endif
 
+    if (o->op_type == OP_SORT) {
+        GvMULTI_on(gv_fetchpv("a", TRUE, SVt_PV)); 
+        GvMULTI_on(gv_fetchpv("b", TRUE, SVt_PV)); 
+    }
+
     if (o->op_flags & OPf_STACKED)
        simplify_sort(o);
     if (o->op_flags & OPf_STACKED) {                /* may have been cleared */