especially the updated code shows a very flexible and generic solution.
and since nobody seems to have mentioned it here before: Your praxis to use $_ as outer loop-var is prone to very hard to find ugly bugs.
In reply to Re: Print 5 lines before and after pattern match from a list
by LanX
in thread Print 5 lines before and after pattern match from a list
by jayu_rao
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |