From 9fbbe8258ee64b30ca2a9bd24c0177c1bc79aef6 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Wed, 23 Sep 1998 08:09:55 +0000 Subject: [PATCH] warn on C p4raw-id: //depot/perl@1835 --- op.c | 5 ++--- pod/perldiag.pod | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) 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. -- 1.8.3.1