}
$file = catfile($tmpdir, "md$$");
@files = ($file, "$file.db", "$file.dir", "$file.pag");
-{
- my @present = grep -e, @files;
- if (@present && (@failed = grep { not unlink } @present)) {
- warn "Can't unlink @failed! ($!)";
- }
-}
+1 while unlink @files;
tryout('Memoize::AnyDBM_File', $file, 1); # Test 1..4
# tryout('DB_File', $file, 1); # Test 1..4
-unlink $file, "$file.dir", "$file.pag";
+1 while unlink $file, "$file.dir", "$file.pag";
sub tryout {
my ($tiepack, $file, $testno) = @_;
+ tie my %cache => $tiepack, $file, O_RDWR | O_CREAT, 0666
+ or die $!;
memoize 'c5',
- SCALAR_CACHE => ['TIE', $tiepack, $file, O_RDWR | O_CREAT, 0666],
- LIST_CACHE => 'FAULT'
+ SCALAR_CACHE => [HASH => \%cache],
+ LIST_CACHE => 'FAULT'
;
my $t1 = c5($ARG);
# Now something tricky---we'll memoize c23 with the wrong table that
# has the 5 already cached.
memoize 'c23',
- SCALAR_CACHE => ['TIE', $tiepack, $file, O_RDWR, 0666],
+ SCALAR_CACHE => ['HASH', \%cache],
LIST_CACHE => 'FAULT'
;