If you read perlop's description of <> (the "null filehandle" in its nomenclature) it expands out the construct to:
unshift(@ARGV, '-') unless @ARGV; while ($ARGV = shift) { open(ARGV, $ARGV); while (<ARGV>) { ... # code for each line } }
When you re-open any existing filehandle the underlying file is implicitly closed; so each time through the loop the prior file will be closed before the handle is reused.
In reply to Re^4: anonymous filehandes?
by Fletch
in thread anonymous filehandes?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |