in reply to Re: Should we Localize $_ ?
in thread Should we Localize $_ ?

I can remember the first time I came across this. I had always just assumed that $_ was localised, and the book "Programming Perl" didn't even mention that it was a dangerous global.

So I checked back through most of the complex code I was writing, found it didn't affect any of my other code, told my programming partner in cryme about it, and made a policy of not calling any functions when I was making use of $_. ie, I decided that if your loop is big enough to call functions, you should be naming the loop variable.

I think there should be really big warnings about this, though.