in reply to Reading in the first 10 lines of a file
or alternatively:
open my $tenlines, "|head myfile.txt"; print $tenlines; [download]