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;
In reply to Re: Reading nth line from a file
by brsaravan
in thread Reading nth line from a file
by perlthirst
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |