Help for this page

Select Code to Download


  1. 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() }"
    
  2. 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() }"
    
  3. or download this
    #!/usr/bin/env perl
    
    ...
    sub FETCH {
      thaw $_[0][0]{$_[1]}
    }