in reply to Getting next line after matched one
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; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting next line after matched one
by Solo (Deacon) on Dec 30, 2004 at 20:53 UTC |