Don't ask to ask, just ask | |
PerlMonks |
Re: Re: fixing use ofby clintp (Curate) |
on Dec 18, 2001 at 02:25 UTC ( [id://132697]=note: print w/replies, xml ) | Need Help?? |
Not to nitpick, but thought you might find this interesting:
This prints "656". What is means is, that within the subroutine foo, I can get to the package $var without having to use a full package name ($main::var). The our declaration makes it clear that within this lexical scope "$var" means the package variable, not the lexical $var that exists in the enclosing scope. Sometimes there are uses for "our" inside of subroutines. update: of course I meant $main::var
In Section
Seekers of Perl Wisdom
|
|