in reply to Re: skipping the first line of a file
in thread skipping the first line of a file
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: skipping the first line of a file
by johngg (Canon) on Jun 12, 2009 at 22:44 UTC |
In Section
Seekers of Perl Wisdom