my $discard = <$fh> for 1 .. 1; # $discard no longer in scope here.
I don't get the point, in what sense is your example better than this?
<$fh>;or
<$fh> for 0..2;The diamond operator doesn't use $_ as default, so using it in "void" context silently reads the next line of the filehandle
citromatik
In reply to Re^2: skipping the first line of a file
by citromatik
in thread skipping the first line of a file
by Angharad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |