From: Graham Barr Date: Wed, 3 Mar 1999 17:23:56 +0000 (-0600) Subject: exempt $foo::a,$foo::b from warnings only if sort() was seen in package foo X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=39ab52836386b91d2e2c323dd305cf42e6be3133;p=p5sagit%2Fp5-mst-13.2.git 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 p4raw-id: //depot/perl@3067 --- diff --git a/gv.c b/gv.c index ff278cc..ae77d28 100644 --- 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 --- 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 */