....
"globally" means in current package (main by default)
$::foo is shorthand for $main::foo
So you have two globals ($P::A/$main::A) and a lexical ($A)
If you use warnings you'll get a warning about "my $A" being made invisible by "our $A" ( "our" variable $A masks earlier declaration in same scope )
Tutorials: Variables and Scoping: Coping with Scoping, Lexical scoping like a fox
In reply to Re: how to declare a package variable
by Anonymous Monk
in thread how to declare a package variable
by scigeek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |