![]() |
|
No such thing as a small change | |
PerlMonks |
Re: $_ scoping issuesby tilly (Archbishop) |
on Jul 14, 2003 at 19:39 UTC ( #274127=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|