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

No, while(<>) does not create a newly scoped $_.

Behold:

require 5.6.1; use strict; use warnings; my @array= (1,2,3,4,5); foo() foreach (@array); print "@array\n"; sub foo { while (<DATA>) { return } # silly, but makes a small example with little input. } __DATA__ clobbered clobbered clobbered clobbered clobbered