in reply to Re^2: perl one liner to print a linein thread perl one liner to print a line
I prefer:
perl -ne'print and close ARGV if $. == 4' file.txt [download]
It works better with multiple files on the command line. ;-)