diff options
-rw-r--r-- | op.c | 5 | ||||
-rw-r--r-- | pod/perldiag.pod | 8 |
2 files changed, 6 insertions, 7 deletions
@@ -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 8d213235a8..20cae6c197 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. |