SPUG: Confusing behaivior with exported variables
tyemq at cpan.org
Mon Mar 23 18:06:33 PDT 2009
On Mon, Mar 23, 2009 at 3:24 PM, Mark Mertel <mark.mertel at yahoo.com> wrote:
> Globals are not recommended. You could make them package variables and
> declare them with 'my' or 'our', and then access them using the package name
> $Neo::Web::Session, or $Darley::Supers::CurrentUser when from outside the
You are muddling several different things together there.
Complaining about "globals" and then recommending "our" is contradictory
since "our" is used to declare a global variable.
Recommending "my" along with "using the package name" is bad advice since it
won't work (you would be accessing different variables).
I'll leave the in-depth explaining of the differences between "lexical
variables" and "package globals" to other sources, but those are the two
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the spug-list