Subject: | Behavior change between Memoize 1.02 and 1.03 |
The attached test script is successful with Memoize::Saves 0.67 and Memoize 1.02, but fails with Memoize 1.03.
Regards,
Slaven
Subject: | memoize.pl |
#!/usr/bin/perl
use strict;
use Memoize;
use Test::More 'no_plan';
my %cache;
memoize 'test_memoize',
SCALAR_CACHE => ['TIE', 'Memoize::Saves',
HASH => \%cache, REGEX => qr/^something/,
],
LIST_CACHE => 'MERGE',
;
my $called = 0;
sub test_memoize {
$called++;
"something";
}
my $first = test_memoize();
my $second = test_memoize();
is $first, q{something};
is $second, q{something};
is $called, 1, 'only one call to test_memoize()';