Hello list!

I am attempting to lower the memory load on the server that the following
lines of code creates. Is there any way to speed up this process and lower
memory usage? I read through FILE::SLURP documentation but not sure if that
would help as I need to keep the array @remaining_file_lines.

NOTE: Each file has a different size (ranging from 2kb up to 900mb)

open FILE, "$file.txt"; #  $file is untainted by code before we open the
file
my ($data,$data1,$data2,$data3,$data4,@remaining_file_lines) = <FILE>;
   close FILE; chomp
($data,$data1,$data2,$data3,$data4,@remaining_file_lines);
   return ($data,$data1,$data2,$data3,$data4,@remaining_file_lines);

TIA !!!!
-David

Reply via email to