summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorDan Book <grinnz@grinnz.com>2020-04-01 13:04:35 -0400
committerKarl Williamson <khw@cpan.org>2020-04-01 14:06:34 -0600
commit45f87e658628cd0ee4595d39ffbf774a44c72a1f (patch)
treec9139a9d7ca02e268e28cafbacc10d12efcfb36a /regen
parent5de22a40933c620b62e1f431457593777b99793d (diff)
downloadperl-45f87e658628cd0ee4595d39ffbf774a44c72a1f.tar.gz
warnings.pm - Clarify scoping of $^W examples
Diffstat (limited to 'regen')
-rw-r--r--regen/warnings.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/regen/warnings.pl b/regen/warnings.pl
index 6000c759ef..9fbf607d7a 100644
--- a/regen/warnings.pl
+++ b/regen/warnings.pl
@@ -16,7 +16,7 @@
#
# This script is normally invoked from regen.pl.
-$VERSION = '1.46';
+$VERSION = '1.47';
BEGIN {
require './regen/regen_lib.pl';
@@ -1012,6 +1012,10 @@ disable compile-time warnings you need to rewrite the code like this:
my $b; chop $b;
}
+And note that unlike the first example, this will permanently set C<$^W>
+since it cannot both run during compile-time and be localized to a
+run-time block.
+
The other big problem with C<$^W> is the way you can inadvertently
change the warning setting in unexpected places in your code. For example,
when the code below is run (without the B<-w> flag), the second call