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;
}
}
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.