in reply to Print next N lines after a pattern is matched.
my $print = 0; while (<>) { if (/diff/) { $print = $N; } elsif ($print) { --$print; print; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |