- or download this
use strict;
use warnings;
...
grep { m{^fileid} .. m{^-----} and m{pattern} } <>;
print for @wantedLines;
- or download this
$ cat spw765108.log
a line
...
a pattern outside our bounds
last line
$
- or download this
$ ./spw765108 spw765108.log
a pattern we want
another wanted pattern
$