Think about Loose Coupling | |
PerlMonks |
Re: memory use array vs ref to arrayby NetWallah (Canon) |
on Sep 08, 2016 at 05:59 UTC ( [id://1171363]=note: print w/replies, xml ) | Need Help?? |
According to this article, Each array element consumes a minimum of 24 bytes. Your 4.5 Gigs of memory will accommodate a maximum of 185,834 elements. How does this compare with the record count in your file ? More relevant is the question - WHY do you need to read the entire file into memory? Typical/efficient parsing handles the file one line at a time. IF it is necessary to store the file in memory, would it suffice to store the file in a scalar ? (You could do that by setting $/=undef; prior to reading the file). ...it is unhealthy to remain near things that are in the process of blowing up. man page for WARP, by Larry Wall
In Section
Seekers of Perl Wisdom
|
|