10 print $@ ? "ok 1\n" : "not ok 1 # $@\n";
13 print $@ ? "ok 2\n" : "not ok 2 # $@\n";
15 eval { my $x; memoize(\$x) };
16 print $@ ? "ok 3\n" : "not ok 3 # $@\n";
20 my $dummyfile = './dummydb';
22 my %args = ( DB_File => [],
23 GDBM_File => [$dummyfile, 2, 0666],
24 ODBM_File => [$dummyfile, O_RDWR|O_CREAT, 0666],
25 NDBM_File => [$dummyfile, O_RDWR|O_CREAT, 0666],
26 SDBM_File => [$dummyfile, O_RDWR|O_CREAT, 0666],
28 for $mod (qw(DB_File GDBM_File SDBM_File ODBM_File NDBM_File)) {
31 tie my %cache => $mod, @{$args{$mod}};
32 memoize(sub {}, LIST_CACHE => [HASH => \%cache ]);
34 print $@ =~ /can only store scalars/
35 || $@ =~ /Can't locate.*in \@INC/ ? "ok $n\n" : "not ok $n # $@\n";
36 1 while unlink $dummyfile, "$dummyfile.dir", "$dummyfile.pag";
42 memoize(sub {}, LIST_CACHE => ['TIE', 'WuggaWugga'])
44 print $@ ? "ok 9\n" : "not ok 9 # $@\n";
47 eval { memoize(sub {}, LIST_CACHE => 'YOB GORGLE') };
48 print $@ ? "ok 10\n" : "not ok 10 # $@\n";
51 eval { memoize(sub {}, SCALAR_CACHE => ['YOB GORGLE']) };
52 print $@ ? "ok 11\n" : "not ok 11 # $@\n";