diff options
author | Paul Marquess <paul.marquess@btinternet.com> | 2001-03-25 22:59:15 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-03-28 14:42:14 +0000 |
commit | 7272584d0d275e06fe4442e1b6aecb95109596e4 (patch) | |
tree | 6556284ba80d8cc4b7b6d35a8ebc5bca3001702b /gv.c | |
parent | 3bb2c41528eaee159711f1f3c8caee43068ec4f6 (diff) | |
download | perl-7272584d0d275e06fe4442e1b6aecb95109596e4.tar.gz |
RE: 5.6.0 BUG: Lexical warnings aren't lexical
Message-ID: <000701c0b56e$73944220$07bdfea9@bfs.phone.com>
A variable will be checked for the "use once" warnings if:
1. It is in the scope of a use warnings 'once'
2. It isn't in the scope of the warnings pragma at all AND $^W is set.
Otherwise it won't be checked at all.
Part 1 is what is in perl >= 5.6.0, Part 2 is what I'm fixing.
The enclosed patch partially fixes this issue. What I didn't
get to work was the case where the "used once" warning is enabled
in any file other than the main file.
p4raw-id: //depot/perl@9401
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -731,7 +731,8 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type) gv_init(gv, stash, name, len, add & GV_ADDMULTI); gv_init_sv(gv, sv_type); - if (isLEXWARN_on && isALPHA(name[0]) && ! ckWARN(WARN_ONCE)) + if (isALPHA(name[0]) && ! (isLEXWARN_on ? ckWARN(WARN_ONCE) + : (PL_dowarn & G_WARN_ON ) ) ) GvMULTI_on(gv) ; /* set up magic where warranted */ |