in reply to how to print first 5 lines of a file


Since -p generates a while loop you can also do this:
perl -pe 'last if $. > 5' filename


--
John.