in reply to Reading nth line from a file
my @arrvar = <FH>; map { if ($arrvar[$_] =~ /you have to read the fourth line/) { print "$arrvar[$_+4]"; } elsif ($arrvar[$_] =~ /you have to read the second line/) { print "$arrvar[$_+2]"; } }0..$#arrvar;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reading nth line from a file
by perlthirst (Scribe) on Dec 19, 2008 at 06:44 UTC |