in reply to Re: Getting next line after matched one
in thread Getting next line after matched one

I think it is as simple as reversing the tests and using an elsif in trammell's example to cover his "special" case...

my $flag = 0; while( <FILE> ) { if ( /test/ ) { print; $flag = 1; } elsif ( $flag ) { print; $flag = 0; } }

--Solo

--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.