in reply to Capturing the first and last line of a file ?
tie @array, 'Tie::File', $fname or die "Can't tie $fname: $!"; my $first = shift (@array); # First line of the file my $last = pop (@array); # Last line of the file untie @array;
-------------------------------- SV* sv_bless(SV* sv, HV* stash);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Capturing the first and last line of a file ?
by linux454 (Pilgrim) on May 06, 2003 at 20:07 UTC |