in reply to How can I make a hash use less memory

One method to save a bit of memory could be to avoid to store the data in a hash of arrays. A simple Hash could reduce the necessary data. I'm imaginating a pseudo code like:
while (<IN>) { my ($key, $x, $y) = split; my @from_cache = split ' ', $cache{$key}; $from_cache[0] += $x; $from_cache[1] += $y; $cache{$key} = join ' ', @from_cache; }
But of course, to use a database is the longterm right answer, as my solution is only a dirty hack :-)

Replies are listed 'Best First'.
Re: Re: How can I make a hash use less memory
by kevyt (Scribe) on Oct 11, 2002 at 18:39 UTC
    thanks to everyone. I will give this a try.