in reply to How to make global variable, like %ENV

Update: Seems I misunderstood the question. Sorry.

Take a look at the use vars; pragma.


Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!

Replies are listed 'Best First'.
Re: Re: How to make global variable, like %ENV
by gmpassos (Priest) on Oct 07, 2002 at 17:17 UTC
    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".