$_ is localized in for loops, but not while loops. (Indeedy any variable is localized in a for loop. Even lexical variables.)
In reply to Re^2: Variable being clobbered by a seemingly unrelated while loop
by tobyink
in thread Variable being clobbered by a seemingly unrelated while loop
by texh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |