while (<>) { ... # code for each line } is equivalent to the following Perl-like pseudo code: unshift(@ARGV, '-') unless @ARGV; while ($ARGV = shift) { open(ARGV, $ARGV); while (<ARGV>) { ... # code for each line } }
I would expect the open to fail silently.(There is no explicit test for errors.) The read on the unopened filehandle should return a false value. The loop would terminate without ever executing the print statement.
In reply to Re^2: while(<>) in perl 5.22
by BillKSmith
in thread while(<>) in perl 5.22
by xorl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |