Help for this page
perl -ne "m/foo/ and die @@ ; shift(@@) if push(@@,$_)>5" myfile.txt
perl -Mstrict -ne "m/addr/ and eval {print @@; exit}; shift(@@) if pus +h(@@,$_)>5" myfile.txt