4 use Memoize 0.45 qw(memoize unmemoize);
6 # use Memoize::NDBM_File;
7 # $Memoize::NDBM_File::Verbose = 0;
23 eval {require Memoize::NDBM_File};
32 1 while unlink $file, "$file.dir", "$file.pag", "$file.db";
33 tryout('Memoize::NDBM_File', $file, 1); # Test 1..4
34 1 while unlink $file, "$file.dir", "$file.pag", "$file.db";
37 my ($tiepack, $file, $testno) = @_;
40 tie my %cache => $tiepack, $file, O_RDWR | O_CREAT, 0666
44 SCALAR_CACHE => [HASH => \%cache],
50 print (($t1 == 5) ? "ok $testno\n" : "not ok $testno\n");
52 print (($t2 == 5) ? "ok $testno\n" : "not ok $testno\n");
55 # Now something tricky---we'll memoize c23 with the wrong table that
56 # has the 5 already cached.
58 SCALAR_CACHE => [HASH => \%cache],
65 print (($t3 == 5) ? "ok $testno\n" : "not ok $testno\n");
67 print (($t4 == 5) ? "ok $testno\n" : "not ok $testno\n");