DaveMonk has asked for the wisdom of the Perl Monks concerning the following question:
At the start of the code (not given here) I have a variable containing the first line in the file: $b = $file[0] and then the foreach loop. How can I make it so that once that first line is read and given to the variable, it is no longer read... as it interferes with my loop at the momentopen (FILE, shift); my @file = <FILE>; foreach $a (@file) { ...etc... } close (FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Read and skip a line
by Corion (Patriarch) on Apr 15, 2012 at 19:25 UTC | |
by DaveMonk (Acolyte) on Apr 15, 2012 at 20:41 UTC | |
by NetWallah (Canon) on Apr 15, 2012 at 21:34 UTC | |
|
Re: Read and skip a line
by jwkrahn (Abbot) on Apr 15, 2012 at 23:33 UTC |