This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Allow ${^WARNING_BITS} to turn off lexical warnings
authorFather Chrysostomos <sprout@cpan.org>
Fri, 27 Jan 2012 04:43:17 +0000 (20:43 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 27 Jan 2012 04:43:17 +0000 (20:43 -0800)
commit7e4f04509c6d4e8d2ed0e31eaf59004e5c930b39
tree9a582799ceb6695192fb8324f9b7684a759767cc
parentcc88c9aaa7ecb8334614c515caf0da2d5538403b
Allow ${^WARNING_BITS} to turn off lexical warnings

Various magical modules copy hints from one scope to another.  But
copying ${^WARNING_BITS} doesn’t always copy the same hints.  If lexi-
cal warnings are not on at all, ${^WARNING_BITS} returns a different
value depending on the current value of $^W.  Setting ${^WARNING_BITS}
to its own value when $^W is true will stop $^W from being able to
control the warnings in the current compilation scope.  Setting
${^WARNING_BITS} to its own value when $^W is false causes even
default warnings to be suppressed.

This commit makes undef a special value that represents the default
state, in which $^W controls warnings.
lib/warnings.pm
mg.c
regen/warnings.pl
t/comp/hints.t