in reply to Re: <STDIN> not initializing $_
in thread <STDIN> not initializing $_
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
|
|---|