in reply to Re: How to make global variable, like %ENV
in thread How to make global variable, like %ENV

This is not what I want. The use vars allow the access to the variable from other packages, but I still need to declare the package name with the variable: %foo::MYGLOBAL

Wha I want is the same that happens with %ENV. When I say $ENV{foo} Perl always look in: %main::ENV.

The nearest resource to do that is the our(), but this only works in the same scope. If you make a require of a file, inside it the previous our() doesn't work!

But, thanks for the reply!

Graciliano M. P.
"The creativity is the expression of the liberty".

  • Comment on Re: Re: How to make global variable, like %ENV