in reply to Read and skip a line
Look at the functions for array manipulation: shift, pop, unshift and push - and splice.
You might want to iterate over the file while reading, instead of loading it into memory as a whole. Then the next keyword could be of interest to you:
my $first; while (<FILE>) { s/\s+$//; # strip newline and whitespace from end of line if( ! $first++) { print "The first line is '$_'\n"; next; }; print "Some other line is '$_'\n"; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Read and skip a line
by DaveMonk (Acolyte) on Apr 15, 2012 at 20:41 UTC | |
by NetWallah (Canon) on Apr 15, 2012 at 21:34 UTC |