> our tells you something is "global" where you declare the variable, but it doesn't tell you that where you use it.
I have problems to follow. our $var creates a lexically scoped alias to a package variable $PKG::var whith PKG for the current __PACKAGE__ . If you are afraid to loose count "where you use it" just limit the scope, much the same way you do with private vars declared with my.
> of a g prefix is an immediate and obvious reminder at the point of use that this is a global variable.
Then maybe consider full qualification instead of a g_ prefix.
Using $PKG::var is IMHO much clearer, and $::var is a handy shortcut for $main::var
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^6: Pointers and References
by LanX
in thread Pointers and References
by Leudwinus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |