in reply to Re: Reading a pattern and a number of lines after it
in thread Reading a pattern and a number of lines after it

You didn't print the line that the match was on, which was stipulated. I also don't like having it wait forever for more input files. A better cheating solution is therefore:
perl -ne'die$_,(<>)[0..3]if/ou/' test.txt
(Erm, OK. I may have just printed to the wrong filehandle... :-)

Replies are listed 'Best First'.
Re: Re (tilly) 2: Reading a pattern and a number of lines after it
by jryan (Vicar) on Jan 09, 2002 at 06:37 UTC
    I stand corrected; your cheating solution through the use of additional cheating is much better than mine! I just whipped mine up real quick to spite blakem, I didn't check it as thoroughly as I should :)