4 use Memoize 0.45 qw(memoize unmemoize);
6 # use Memoize::SDBM_File;
7 # $Memoize::GDBM_File::Verbose = 0;
23 eval {require Memoize::SDBM_File};
32 1 while unlink $file, "$file.dir", "$file.pag";
34 1 while unlink "$file.sdbm_dir";
36 tryout('Memoize::SDBM_File', $file, 1); # Test 1..4
37 1 while unlink $file, "$file.dir", "$file.pag";
39 1 while unlink "$file.sdbm_dir";
43 my ($tiepack, $file, $testno) = @_;
45 tie my %cache => $tiepack, $file, O_RDWR | O_CREAT, 0666
49 SCALAR_CACHE => [HASH => \%cache],
55 print (($t1 == 5) ? "ok $testno\n" : "not ok $testno\n");
57 print (($t2 == 5) ? "ok $testno\n" : "not ok $testno\n");
60 # Now something tricky---we'll memoize c23 with the wrong table that
61 # has the 5 already cached.
63 SCALAR_CACHE => [HASH => \%cache],
70 print (($t3 == 5) ? "ok $testno\n" : "not ok $testno\n");
72 print (($t4 == 5) ? "ok $testno\n" : "not ok $testno\n");