diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-01-16 17:57:03 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-01-16 17:57:03 +0000 |
commit | 747afe9f72bf33257cdb451a75c2349469736b92 (patch) | |
tree | 420bf1eb12b6589a335983032ed5a9ce08b08695 /t | |
parent | 628e1a40d854546bd93e9304795a0b62669c91c2 (diff) | |
parent | 5cc9f7f1786a8562a94212ddd66763a7c7971733 (diff) | |
download | perl-747afe9f72bf33257cdb451a75c2349469736b92.tar.gz |
Integrate with Sarathy.
p4raw-id: //depot/cfgperl@4807
Diffstat (limited to 't')
-rw-r--r-- | t/pragma/strict-vars | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/t/pragma/strict-vars b/t/pragma/strict-vars index b8108d278c..dc11f5d59e 100644 --- a/t/pragma/strict-vars +++ b/t/pragma/strict-vars @@ -307,3 +307,35 @@ print our $fred,"\n"; EXPECT 2 1 +######## + +# "nailed" our declaration visibility across package boundaries +use strict 'vars'; +our $foo; +$foo = 20; +package Foo; +print $foo, "\n"; +EXPECT +20 +######## + +# multiple our declarations in same scope, different packages, no warning +use strict 'vars'; +use warnings; +our $foo; +${foo} = 10; +package Foo; +our $foo = 20; +print $foo, "\n"; +EXPECT +20 +######## + +# multiple our declarations in same scope, same package, warning +use strict 'vars'; +use warnings; +our $foo; +${foo} = 10; +our $foo; +EXPECT +"our" variable $foo masks earlier declaration in same scope at - line 7. |