diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-25 20:22:01 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-25 20:22:01 +0000 |
commit | 336337397a650655cf01ecfa4aab8aa7e70c42f4 (patch) | |
tree | 8adcada4f182bb8e26ad7b84779e4cbbfb3d3a95 /t | |
parent | d08ede9a86fc6f23c9d8f6a6b0ba2b5edd36ad0f (diff) | |
download | perl-336337397a650655cf01ecfa4aab8aa7e70c42f4.tar.gz |
produce redeclaration warning on C<our $foo; { our $foo; ... }>
p4raw-id: //depot/perl@4891
Diffstat (limited to 't')
-rw-r--r-- | t/pragma/strict-vars | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/pragma/strict-vars b/t/pragma/strict-vars index dc11f5d59e..9352c4b04c 100644 --- a/t/pragma/strict-vars +++ b/t/pragma/strict-vars @@ -339,3 +339,18 @@ ${foo} = 10; our $foo; EXPECT "our" variable $foo masks earlier declaration in same scope at - line 7. +######## + +# multiple our declarations in same scope, same package, warning +use strict 'vars'; +use warnings; +our $foo; +{ + our $foo; + package Foo; + our $foo; +} +EXPECT +"our" variable $foo redeclared at - line 7. +(Did you mean "local" instead of "our"?) +Name "Foo::foo" used only once: possible typo at - line 9. |