which has an implicit boolean test in it.Actually, an implicit defined() test in it:
so that e.g. a 0 with no following newline at the end of a file still goes into the body of the loop.$ perl -MO=Deparse -e'while (<INPUT>) {}' while (defined($_ = <INPUT>)) { (); } -e syntax OK
In reply to Re^2: Explaining Perl truth to beginners
by ysth
in thread Explaining Perl truth to beginners
by shemp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |