in reply to How can we read each line from a file onto an array?

my @lines = <FILE>
above loads the whole file at once in memory.

Instead, you can do something like

while(my $line=<FILE>){ do_something; }
This code will still traverse the whole file, so wont be faster but it will load only one line at a time in the memory - helpful if you want to parse 4GB file and have only 2 GB RAM ;)