An alternative to File::ReadBackwards would be the tac(1) command:
NAME
tac - concatenate and print files in reverse
For example:
open(ELIF,"tac file.foo |") or die "Couldn't tac file: $!\n"; while (<ELIF>) { push @lines,$_ if /criteria/; last if @lines > $n; }
In reply to Re: last $n lines that match a criteria
by sgifford
in thread last $n lines that match a criteria
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |