-
-
29 Nov 2010 18:22:53 UTC
- Distribution: Memoize-Saves
- Module version: 0.67
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (2)
- Testers (143 / 0 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (10.98KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors-
Joshua Gerth
- Dependencies
- Memoize
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Memoize::Saves - Plug-in module to specify which return values should be memoized
SYNOPSIS
use Memoize; memoize 'function', SCALAR_CACHE => [TIE, Memoize::Saves, CACHE => [ "word1", "word2" ], DUMP => [ "word3", "word4" ], REGEX => "Regular Expression", HASH => $cache_hashref, ],
DESCRIPTION
Memoize::Saves is a plug-in module for Memoize. It allows the user to specify which values should be cached or which should be dumped. Please read the manual for Memoize for background information.
Use the CACHE option to specify a list of return values which should be memoized. All other values will need to be recomputed each time.
Use the DUMP option to specify a list of return values which should not be memoized. Only these values will need to be recomputed each time.
Use the REGEX option to specify a Regular Expression which must match for the return value to be saved. You can supply either a plain text string or a compiled regular expression using qr//. Obviously the second method is prefered.
Specifying multiple options will result in the least common denominator being saved.
You can use the HASH option to string multiple Memoize Plug-ins together:
tie my %disk_hash => 'GDBM_File', $filename, O_RDWR|O_CREAT, 0666; tie my %expiring_cache => 'Memoize::Expire', LIFETIME => 5, HASH => \%disk_cache; tie my %cache => 'Memoize::Saves', REGEX => qr/my/, HASH => \%expiring_cache; memoize ('printme', SCALAR_CACHE => [HASH => \%cache]);
CAVEATS
This module is experimental, and may contain bugs. Please report bugs to
bug-Memoize-Saves@rt.perl.org
.If you are going to use Memoize::Saves with Memoize::Expire it is important to use it in that order. Memoize::Expire changes the return value to include expire information and it may no longer match your CACHE, DUMP, or REGEX.
SEE ALSO
AUTHOR
Joshua Gerth <gerth@teleport.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Joshua Gerth.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Memoize::Saves, copy and paste the appropriate command in to your terminal.
cpanm Memoize::Saves
perl -MCPAN -e shell install Memoize::Saves
For more information on module installation, please visit the detailed CPAN module installation guide.