You need to consider the "special" case where you have two adjacent matching lines; the logic in this code may not suffice.my $flag = 0; while (<FILE>) { if ($flag) { $flag = 0; do_something($_); } if (/pattern/) { $flag = 1; next; } }
In reply to Re: Getting next line after matched one
by trammell
in thread Getting next line after matched one
by ramthen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |