in reply to Re: Export global variables not working correctly
in thread Export global variables not working correctly

What's this about not trying to use packages as namespaces? The last time I looked at perlmod, I read this:

Perl provides a mechanism for alternative namespaces to protect packages from stomping on each other's variables. In fact, there's really no such thing as a global variable in Perl. The package statement declares the compilation unit as being in the given namespace.

And perlobj says:

A package is simply a namespace containing variables and subroutines.


Dave

  • Comment on Re^2: Export global variables not working correctly

Replies are listed 'Best First'.
Re^3: Export global variables not working correctly
by cheako (Beadle) on Mar 06, 2015 at 07:18 UTC
    This thinking only works if you can stop any one from using bless and your package. Afterwards your namespace is no longer just a namespace.
      This thinking only works if you can stop any one from using bless and your package. Afterwards your namespace is no longer just a namespace.

      I've tried to wrap my head around what you are saying and am not getting anything. Would you mind showing a quick code example of the situation you are talking about?