From: Gurusamy Sarathy Date: Wed, 23 Sep 1998 08:09:55 +0000 (+0000) Subject: warn on C X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9fbbe8258ee64b30ca2a9bd24c0177c1bc79aef6;p=p5sagit%2Fp5-mst-13.2.git warn on C p4raw-id: //depot/perl@1835 --- diff --git a/op.c b/op.c index 58cf511..9b2284d 100644 --- a/op.c +++ b/op.c @@ -131,12 +131,11 @@ pad_allocmy(char *name) for (off = AvFILLp(PL_comppad_name); off > PL_comppad_name_floor; off--) { if ((sv = svp[off]) && sv != &PL_sv_undef - && SvIVX(sv) == 999999999 /* var is in open scope */ && strEQ(name, SvPVX(sv))) { warner(WARN_UNSAFE, - "\"my\" variable %s masks earlier declaration in same scope", - name); + "\"my\" variable %s masks earlier declaration in same %s", + name, (SvIVX(sv) == 999999999 ? "scope" : "statement")); break; } } diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 8d21323..20cae6c 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -33,11 +33,11 @@ The symbols C<"%(-?@> sort before the letters, while C<[> and C<\> sort after. to try to declare one with a package qualifier on the front. Use local() if you want to localize a package variable. -=item "my" variable %s masks earlier declaration in same scope +=item "my" variable %s masks earlier declaration in same %s -(W) A lexical variable has been redeclared in the same scope, effectively -eliminating all access to the previous instance. This is almost always -a typographical error. Note that the earlier variable will still exist +(W) A lexical variable has been redeclared in the current scope or statement, +effectively eliminating all access to the previous instance. This is almost +always a typographical error. Note that the earlier variable will still exist until the end of the scope or until all closure referents to it are destroyed.