local $_; is one way to avoid writing to it, since the 'it' is now different.
Update: Hm.. It's a bit worse than that.
foreach ( qw(foo) ) { $_ = 1 }
also exhibits the problem.
In reply to Re: while(<>) { ... } considered harmful
by dws
in thread while(<>) { ... } considered harmful
by IlyaM
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |