perl -MMemoize -MMemoize::Expire -E " \ sub f { ('X',int rand 100) }; \ tie my %cache => 'Memoize::Expire', NUM_USES => 3; \ memoize 'f', LIST_CACHE => 'MERGE', \ SCALAR_CACHE => [ HASH => \%cache ]; \ for (1..6) { say f() }"