cpan/Memoize/Memoize.pm Memoize
cpan/Memoize/Memoize/SDBM_File.pm Memoize glue layer for SDBM_File
cpan/Memoize/Memoize/Storable.pm Memoize glue layer for Storable
-cpan/Memoize/README Memoize release notes
cpan/Memoize/t/array_confusion.t Memoize ambiguous array return tests
cpan/Memoize/t/array.t Memoize array context return tests
cpan/Memoize/t/correctness.t Memoize basic correctness tests
# You may copy and distribute this program under the
# same terms as Perl itself. If in doubt,
# write to mjd-perl-memoize+@plover.com for a license.
-#
-# Version 1.01 $Revision: 1.18 $ $Date: 2001/06/24 17:16:47 $
package Memoize;
-$VERSION = '1.01_03';
+$VERSION = '1.02';
# Compile-time constants
sub SCALAR () { 0 }
# Otherwise, we cached an array containing the returned list:
return @$val;
} else {
- my @q = &{$info->{U}}(@_);
- $cache->{$argstr} = $info->{O}{LIST_CACHE} eq 'MERGE' ? $q [0] : \@q;
- @q;
+ my @q = &{$info->{U}}(@_);
+ $cache->{$argstr} = $info->{O}{LIST_CACHE} eq 'MERGE' ? $q [0] : \@q;
+ @q;
}
} else {
croak "Internal error \#42; context was neither LIST nor SCALAR\n";
=head1 SYNOPSIS
- # This is the documentation for Memoize 1.01
+ # This is the documentation for Memoize 1.02
use Memoize;
memoize('slow_function');
slow_function(arguments); # Is faster than it was before
# require 5.00556;
use Carp;
$DEBUG = 0;
-$VERSION = '1.00';
+$VERSION = '1.02';
# This package will implement expiration by prepending a fixed-length header
# to the font of the cached data. The format of the header will be:
also persistent or that it has some other interesting semantics. The
example above demonstrates how to do this, as does C<Memoize::Expire>.
+Another sample module, L<Memoize::Saves>, is available in a separate
+distribution on CPAN. It implements a policy that allows you to
+specify that certain function values would always be looked up afresh.
+See the documentation for details.
+
=head1 ALTERNATIVES
Brent Powers has a C<Memoize::ExpireLRU> module that was designed to
+++ /dev/null
-
-Name: Memoize
-What: Transparently speed up functions by caching return values.
-Version: 1.00
-Author: Mark-Jason Dominus (mjd-perl-memoize+@plover.com)
-
-################################################################
-
-How to build me:
-
- perl Makefile.PL
- make
- make test
-
-There's a very small chance that the tests in speed.t and
-expire_module_t.t might fail because of clock skew or bizarre system
-load conditions. If the tests there fail, rerun them and see if the
-problem persists.
-
-If the tests work,
-
- make install
-
-If not, please send me a report that mentions which tests failed.
-The address is: mjd-perl-memoize+@plover.com.
-
-################################################################
-What's new since 0.66:
-
-Minor documentation and test changes only.
-
-################################################################
-What's new since 0.65:
-
-Test changes only.
-
- 0.62 was the fist version that would be distributed with Perl.
- I got so absorbed in integrating it that I wrote some tests
- that used Time::HiRes. I knew this was safe because
- Time::HiRes is also distributed with the same versions of
- Perl. I totally forgot that some people will get the module
- off of CPAN without Perl and they may not have TIme::HiRes.
- Sorry!
-
-################################################################
-What's new since 0.62:
-
-
- N O T I C E !
-
- ****************************************************************
- ** **
- ** The TIE option is now strongly deprecated. It will be **
- ** permanently removed in the NEXT release of Memoize. **
- ** Please convert all extant software to use HASH instead. **
- ** **
- ** See the manual for details. **
- ** **
- ****************************************************************
-
-I'm sorry about this. I hate making incompatible changes. But as of
-v0.65, Memoize is included in the Perl core. It is about to become
-much more difficult to make incompatible interface changes; if I don't
-get rid of TIE now, I may not get another chance.
-
-TIE presented serious problems. First, it had a bizarre syntax. But
-the big problem was that it was difficult and complicated for
-expiration manager authors to support; evern expiration manager had to
-duplicate the logic for handling TIE. HASH is much simpler to use,
-more powerful, and is trivial for expiration managers to support.
-
-Many long-awaited cleanups and bug fixes.
-
-Memoize now works under threaded perl
-
-Slow tests speeded up. More test file improvements.
-
-Long-standing LIST_CACHE bug cleared up---it turns out that there
-never was a bug. I put in tests for it anyway.
-
-Manual increased.
-