in reply to $_ scoping issues
See $_ haters anonymou for a discussion of the scoping of $_.
If you wish to use it widely in loops, then it is up to you to either localize it before calling anything that manipulates it, or to localize it before assigning to it.
It is, of course, better to never assign to $_ without localizing it, but you can't always control other people's code. Therefore the paranoid call local on $_ early and often.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: $_ scoping issues
by pemungkah (Priest) on Jul 15, 2003 at 16:18 UTC | |
by tilly (Archbishop) on Jul 16, 2003 at 01:42 UTC | |
by swkronenfeld (Hermit) on Jul 15, 2003 at 17:27 UTC |
In Section
Seekers of Perl Wisdom