summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-01-16 17:57:03 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-01-16 17:57:03 +0000
commit747afe9f72bf33257cdb451a75c2349469736b92 (patch)
tree420bf1eb12b6589a335983032ed5a9ce08b08695 /t
parent628e1a40d854546bd93e9304795a0b62669c91c2 (diff)
parent5cc9f7f1786a8562a94212ddd66763a7c7971733 (diff)
downloadperl-747afe9f72bf33257cdb451a75c2349469736b92.tar.gz
Integrate with Sarathy.
p4raw-id: //depot/cfgperl@4807
Diffstat (limited to 't')
-rw-r--r--t/pragma/strict-vars32
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.