in reply to Re: Re: Can't localize lexical variable $var at...
in thread Can't localize lexical variable $var at...
No, it cannot. If you { my $var; some_sub(); }, then some_sub() cannot see $var. On the other hand, if you { local $var; some_sub(); }, then some_sub() can. (And that's why you shouldn't local unless you have a clear reason for it and not before you have signed a contract that you clearly understand that perl is not liable if you botch up at that point, and that you accept the consequences.)
Makeshifts last the longest.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re^3: Can't localize lexical variable $var at...
by Courage (Parson) on Jun 09, 2002 at 20:57 UTC | |
by Aristotle (Chancellor) on Jun 09, 2002 at 21:06 UTC | |
by Courage (Parson) on Jun 09, 2002 at 21:12 UTC |
In Section
Seekers of Perl Wisdom