Memoize-Lift
view release on metacpan or search on metacpan
use warnings;
use strict;
use Test::More tests => 6;
BEGIN { use_ok "Memoize::Lift", qw(lift); }
our($a, $i);
BEGIN { $a = undef; }
sub aa() { lift(do { $i++; $a }) }
is $i, 1;
$a = 2;
is aa(), undef;
is $i, 1;
$a = 3;
is aa(), undef;
is $i, 1;
1;
( run in 0.742 second using v1.01-cache-2.11-cpan-364913b4093 )