4 use Memoize 0.45 qw(memoize unmemoize);
21 eval {require GDBM_File};
29 if (eval {require File::Spec::Functions}) {
30 File::Spec::Functions->import();
32 *catfile = sub { join '/', @_ };
34 $tmpdir = $ENV{TMP} || $ENV{TMPDIR} || '/tmp';
35 $file = catfile($tmpdir, "md$$");
36 unlink $file, "$file.dir", "$file.pag";
37 tryout('GDBM_File', $file, 1); # Test 1..4
38 unlink $file, "$file.dir", "$file.pag";
41 my ($tiepack, $file, $testno) = @_;
45 SCALAR_CACHE => ['TIE', $tiepack, $file, O_RDWR | O_CREAT, 0666],
51 print (($t1 == 5) ? "ok $testno\n" : "not ok $testno\n");
53 print (($t2 == 5) ? "ok $testno\n" : "not ok $testno\n");
56 # Now something tricky---we'll memoize c23 with the wrong table that
57 # has the 5 already cached.
59 SCALAR_CACHE => ['TIE', $tiepack, $file, O_RDWR, 0666],
66 print (($t3 == 5) ? "ok $testno\n" : "not ok $testno\n");
68 print (($t4 == 5) ? "ok $testno\n" : "not ok $testno\n");