my @history; while (<>) { print @history if /pattern/; push @history, $_; shift @history if @history > 3; }
No direction was given for handling overlapping matches.
In reply to Re: How can I print three lines before pattern match?
by ikegami
in thread How can I print three lines before pattern match?
by neurotoxx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |