On Tue, 16 May 2000 13:32:56 -0500, "Cornish, Merrill"
<[EMAIL PROTECTED]> wrote:
>Also beware: while(<FILE>) will stop reading if it hits an empty line in
>the middle of the file because an empty string counts as "false" in a Perl
>boolean compare. A safer way is
>
> while(defined($line = <FILE>))
>
>so that only the end-of-file will cause you to break out of the loop.
This is not true. while(<FILE>) has an implicit defined() test (since
Perl 5.001 days). Starting with 5.005, even a *simple* assignment is
automatically surrounded with a defined() test if the assigned value is
the result of a readline, glob, readdir or each operation.
Check perlop.pod.
-Jan
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]