in reply to Why localize $_ in the map block?
in thread how could I use map here?
adrianh++
It's often (always?) a good practice to localize $_ whenever you need to use it, like any other global variable: it could be accessed by your program, or used by modules (File::Find is one of them AFAIK) and it's not fair to mess up with it.
With localizing it you have a better protection: if something elsewhere in your code relied on $_'s value you won't be messing with it.
Ciao!
--bronto
The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
--John M. Dlugosz
|
|---|