2009/11/2 Thomas Bätzler <t.baetz...@bringe.com>:
> while( my $line = <$file> ){
> <snip>
> }

Won't this loop terminate early if there is a blank line or a line
containing only '0'? If I do a readline loop I always do:
while (defined ($line = <$file>))

Is there something magical happening here I don't know about? I know
about the magical:

while (<$file>)

which is equivalent to:

while (defined($_ = <$file>))

but I don't know of any magic in the while loop at the top.

Phil

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to