diff options
author | Father Chrysostomos <perlbug-followup@perl.org> | 2010-04-13 17:20:19 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-04-13 17:45:59 +0200 |
commit | 413ff9f68feafcc9f84f1fbb43e6d6aa91adce9d (patch) | |
tree | b0191cacd067370ef62a75c4c4612e45ae9b7665 /t | |
parent | 0654a75e074535dcbc7f1c16194a38b527c9baa7 (diff) | |
download | perl-413ff9f68feafcc9f84f1fbb43e6d6aa91adce9d.tar.gz |
[perl #73712] ‘Variable is not imported’ cannot be suppressed
The message ‘Variable "%s" is not imported’ cannot be suppressed, even
with -X (local $SIG{__WARN__}=sub{} is what I have to use):
perl -Xle '$foo;use strict; eval q/$foo/ or die "---$@---"'
Variable "$foo" is not imported at (eval 1) line 2.
---Global symbol "$foo" requires explicit package name at (eval 1) line 2.
--- at -e line 1.
This is because we have what appears to the user to be a multi-line
error message. It is in fact a warning ‘Variable...’ followed by an
error ‘Global symbol...’.
The attached patch assigns a warning category to the warning.
Diffstat (limited to 't')
-rw-r--r-- | t/lib/strict/vars | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/t/lib/strict/vars b/t/lib/strict/vars index 16deab9837..87f820f1d2 100644 --- a/t/lib/strict/vars +++ b/t/lib/strict/vars @@ -439,3 +439,10 @@ qr/(?{$foo++})/; EXPECT Global symbol "$foo" requires explicit package name at (re_eval 1) line 1. Compilation failed in regexp at - line 3. +######## +# [perl #73712] 'Variable is not imported' should be suppressable +$dweck; +use strict 'vars'; +no warnings; +eval q/$dweck/; +EXPECT |