in reply to jump lines in log file

Tie::File is likely going to do a better job of dealing with large logs.
DESCRIPTION

Tie::File represents a regular text file as a Perl array. Each element in the array corresponds to a record in the file. The first line of the file is element 0 of the array; the second line is element 1, and so on.

The file is not loaded into memory, so this will work even for gigantic files.

Changes to the array are reflected in the file immediately.

Lazy people and beginners may now stop reading the manual.

use Tie::File; my $filename = 'thelog.log' tie my @array, 'Tie::File', $filename or die "can't open file:$filename : $!"; for my $i ( 0 .. $#array ) { my $line = $array[$i]; if ( $line =~ m/MYLOGREGEX/x ) { my $date = $array[ $i - 8 ]; ## do something with $line and $date } }
ps. dictated, but not read.