in reply to Re: Using tie to initialize large datastructures
in thread Using tie to initialize large datastructures

I would like to add a second vote for use Memoize; your lookup functions are expensive and read-only, exactly what memoization is good for.

In addition to the behavior ariels mentions above, I'd like to point out it is easy to persistantly store the memoized data using tie, no muss, no fuss.

use DB_File; tie my %cache => 'DB_File', $filename, O_RDWR|O_CREAT, 0666; memoize 'function', SCALAR_CACHE => [HASH => \%cache];
In addition, Memoize makes a good profiler-- details are available here in Dominus's article.

___ -DA > perl -MPOSIX -e'$ENV{TZ}="US/Eastern";print ctime(10**9)' Sat Sep 8 21:46:40 2001