in reply to Re^3: How to print 5 lines below after a regex match
in thread How to print 5 lines below after a regex match
Or possibly for 1..$few-1;, depending on whether $few includes the matching line or not.use strict; my $few = shift || 3; while (<DATA>) { if (/Update certificate/) { print $_; print scalar <DATA> for 1..$few; } }
|
|---|