in reply to Reading n lines/records from a file
(note the escaping, this would also be shell dependent. I don't think this would work on windows) but that is pretty inefficient because is involves starting another process. I would just do something simple and easy to read and maintain like this:$file_next = `perl -ple 'exit if \$. > 10' $file_upload`;
# # define $file_upload, etc above this # open INFILE, $file_upload or die $!; # or do something more graceful my $file_next; for (1 .. 10) { $file_next .= <INFILE>; } close INFILE;
--
flounder
|
|---|