Not quite.
while (<STDIN>)
is equivalent to
while ($_ = <STDIN>)
but when spelled out explicitly, they're both
while (defined($_ = <STDIN>))
>perl -MO=Deparse -e"while (<STDIN>) {}" while (defined($_ = <STDIN>)) { (); } -e syntax OK >perl -MO=Deparse -e"while ($_ = <STDIN>) {}" while (defined($_ = <STDIN>)) { (); } -e syntax OK
In reply to Re^2: <STDIN> not initializing $_
by ikegami
in thread <STDIN> not initializing $_
by carol
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |