http://www.perlmonks.org?node_id=554412


in reply to upto match please, my one-lina!!

So it can run also under use strict:

perl -Mstrict \ -ne'/regex(?{print @@; exit})/;' \ -e'shift(@@) if push(@@,$_)>5' file