in reply to Re^2: Just when you thought you'd got it: 'foreach $f (@foo)' vs 'foreach (@foo)'
in thread Just when you thought you'd got it: 'foreach $f (@foo)' vs 'foreach (@foo)'

The use of my on Perl special variables didn't come till a recent version of Perl, I believe.

Nevertheless, I think it is a matter of usage whether to lexically scope my $_ within while or dynamically scope it local $_. I can foresee having an amuck() function wanting to read $_ instead of clobbering it.

When I see code like $_ = ... alarm bells in me start ringing! ... and I drone into the need to localize ... :)