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.
In reply to Re^2: Getting next line after matched one
by Solo
in thread Getting next line after matched one
by ramthen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |