Think about Loose Coupling | |
PerlMonks |
Re: Memory usage while tallying instances of lines in a .txt fileby stevieb (Canon) |
on Dec 05, 2016 at 16:42 UTC ( [id://1177243]=note: print w/replies, xml ) | Need Help?? |
This is because you're reading the entire file into an array. To reduce the memory footprint, you're better off reading the file a line at a time. Can you please show us an example of the line you're doing this on?:
We should be able to help you rewrite your code if we know where $index is being gleaned from.
In Section
Seekers of Perl Wisdom
|
|