Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: get n lines before or after a patternby Anonymous Monk |
on Jul 25, 2012 at 15:46 UTC ( [id://983692]=note: print w/replies, xml ) | Need Help?? |
Search for grep, the Unix command, implementation in Perl. There are at least one such implementations posted around here (don't have the (search) links handy); another was posted long ago in comp.lang.perl.misc newsgroup. Yet another is App::Ack; refer to &print_line_with_context & &get_context subs.
In Section
Seekers of Perl Wisdom
|
|