in reply to Reading n lines/records from a file

You could use backticks to call out to perl by simply changing your code to something like this:
$file_next = `perl -ple 'exit if \$. > 10' $file_upload`;
(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:
# # 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