Note that our caused you to access $bar::foo even when you'd have otherwise expected to access $foo::foo.package foo; our $foo = "I'm in foo"; package bar; our $foo = "I'm in bar"; package foo; print "1) $foo\n2) $foo::foo\n3) $bar::foo\n";
For giggles and grins, mix our with $_ when you aren't in package main. Tons of confusion!
In reply to Re: Re: 'our' scoping
by tilly
in thread 'our' scoping
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |