There's more than one way to do things | |
PerlMonks |
Re: Reducing Memory Usageby Gilimanjaro (Hermit) |
on Jul 16, 2004 at 14:19 UTC ( [id://375012]=note: print w/replies, xml ) | Need Help?? |
Another approach:
(untested code follows)
The overload would allow plain old sort to work on the array, and should be pretty fast as the keys to sort on are stored already. The time conversion could possible by done by a function which stores previously converted values in a hash, so you can do a cheap hash lookup instead of an expensive conversion for values you've already seen. You'll need to make sure the filehandle stays open, possibly in the MyObject package so the records can be retreived when they're actually needed</P.
In Section
Seekers of Perl Wisdom
|
|