This:
while( <> ) { ...
...has special meaning in Perl. It's semantically equal to:
while( defined( $_ = <> ) ) { ...
So your loop doesn't terminate upon reading a false value. It terminates when <> returns undef, which can happen when you reach the end of the file.
This is documented in perlop. It really is a special case. The implicit "defined" is just a "Do What I Mean" convenience.
Dave
In reply to Re: while (<FP>) conditionals
by davido
in thread while (<FP>) conditionals
by jktstance
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |