in reply to Re^2: Doubt on defined-ness
in thread Doubt on defined-ness
It seems perl applies its magic test for definedness to any while that involves a filehandle (at least, I couldn't find a case where it didn't apply).
$ perl -MO=Deparse -e 'while (<>) {} while ( <ARGV> ) {} while ( $_ = +<> ) {} while ( $x = <> ) {}' while (defined($_ = <ARGV>)) { (); } while (defined($_ = <ARGV>)) { (); } while (defined($_ = <ARGV>)) { (); } while (defined($x = <ARGV>)) { (); } -e syntax OK
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Doubt on defined-ness
by ikegami (Patriarch) on Jun 18, 2008 at 22:54 UTC |