exempt $foo::a,$foo::b from warnings only if sort() was seen in package foo
Message-ID: <
19990303172356.F7442@dal.asp.ti.com>
Subject: Re: 'use strict' doesn't work for one-letter variables
change#3067 failed package.t due to needless creation of $a and $b;
fixed to do that only for C<sort BLOCK|CODE @foo>, not C<sort(@foo)>
p4raw-link: @3067 on //depot/perl:
39ab52836386b91d2e2c323dd305cf42e6be3133
p4raw-id: //depot/maint-5.005/perl@3182
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);
if (o->op_flags & OPf_STACKED) {
OP *kid = cLISTOPo->op_first->op_sibling; /* get past pushmark */
OP *k;
+
+ if (o->op_type == OP_SORT) {
+ GvMULTI_on(gv_fetchpv("a", TRUE, SVt_PV));
+ GvMULTI_on(gv_fetchpv("b", TRUE, SVt_PV));
+ }
kid = kUNOP->op_first; /* get past rv2gv */
if (kid->op_type == OP_SCOPE || kid->op_type == OP_LEAVE) {
$a =+ 3 ;
EXPECT
Reversed += operator at - line 3.
+Name "main::a" used only once: possible typo at - line 3.
########
#! perl -w
# warnable code, warnings enabled via #! line
$a =+ 3 ;
EXPECT
Reversed += operator at - line 3.
+Name "main::a" used only once: possible typo at - line 3.
########
# warnable code, warnings enabled via compile time $^W
$a =+ 3 ;
EXPECT
Reversed += operator at - line 4.
+Name "main::a" used only once: possible typo at - line 4.
########
# compile-time warnable code, warnings enabled via runtime $^W