Actually, perldoc perlop, in the section on "I/O operators", is very explicit about it:
Ordinarily you must assign the returned value to a variable, but there is one situation where an automatic assignment happens. If and only if the input symbol is the only thing inside the conditional of a while statement (even if disguised as a for(;;)loop), the value is automatically assigned to the global variable $_, destroying whatever was there previously.(emphasis mine)
In reply to Re^2: Uninitialized string warning
by VSarkiss
in thread Uninitialized string warning
by RICH15ARD
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |