- or download this
perl -MMemoize -MMemoize::Expire -E " \
sub f { ('X',int rand 100) }; \
...
memoize 'f', LIST_CACHE => 'MERGE', \
SCALAR_CACHE => [ HASH => \%cache ]; \
for (1..6) { say f() }"
- or download this
perl -MMemoize -MMemoize::Expire -MSerializeValues -E " \
sub f { ('X',int rand 100) }; \
...
memoize 'f', LIST_CACHE => [ HASH => \%cache ], \
SCALAR_CACHE =>'MERGE' ; \
for (1..6) { say f() }"
- or download this
#!/usr/bin/env perl
...
sub FETCH {
thaw $_[0][0]{$_[1]}
}