in reply to grabbing N lines after matching one?

The nicest way to do this in Perl is probably using the .. operator (check the manpage for more variations)

Something like:
while(<>) { if (/first-line-pattern/ .. /last-line-pattern/) { do your stuff; } }