in reply to
Memory use when reading a text file
This is related to your use of for(each), which tries to store the whole file in a temporary array in memory.
Try:
while( my $line = <INP> ){ ... }
[download]
instead. This will simply copy each line into memory as needed.
Comment on
Re: Memory use when reading a text file
Download
Code
In Section
Seekers of Perl Wisdom