The usual mantra at this point is "what have you tried". My guess is you haven't tried anything at all. In fact I bet you haven't even thought hard about it (go ahead, prove me wrong - I'd love to be wrong about this). So lets map the problem into a different domain and see where it gets us:
Consider how you would do it if the lines were instead boxes on a conveyor belt and you had the same problem - remove the 10 boxes that have just gone past if the 10th has a red X on it. If you are sitting right at the end of the belt where the boxes fall off into the hopper of doom you're stuffed. So move your seat along the belt 10 boxes in the direction they are coming from. Now when the red X'd box comes along you have the 10 boxes where you can get at em and remove them from the belt before the fall into the hopper.
Now all you've got to do is figure out how to translate that into Perl. I'll let you think about it a while before giving further hints. ;)
In reply to Re: Delete 10 lines before matched line
by GrandFather
in thread Delete 10 lines before matched line
by briggs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |