in reply to grabbing N lines after matching one?

something like this should do the trick: perl -ne 'print if /match/ .. (++$lines > 4)'