From: Jarkko Hietaniemi Date: Thu, 13 Dec 2001 17:11:42 +0000 (+0000) Subject: Remove Memoize::Saves as requested by mjd. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=37b1fd751b167596eca88f20ca67ea1fe13f96b8;p=p5sagit%2Fp5-mst-13.2.git Remove Memoize::Saves as requested by mjd. p4raw-id: //depot/perl@13676 --- diff --git a/MANIFEST b/MANIFEST index 843d2f5..c587d2f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1063,7 +1063,6 @@ lib/Memoize/ExpireFile.pm Memoize lib/Memoize/ExpireTest.pm Memoize lib/Memoize/NDBM_File.pm Memoize lib/Memoize/README Memoize -lib/Memoize/Saves.pm Memoize lib/Memoize/SDBM_File.pm Memoize lib/Memoize/Storable.pm Memoize lib/Memoize/t/array.t Memoize diff --git a/lib/Memoize/Saves.pm b/lib/Memoize/Saves.pm deleted file mode 100644 index a667bc1..0000000 --- a/lib/Memoize/Saves.pm +++ /dev/null @@ -1,193 +0,0 @@ -package Memoize::Saves; - -$VERSION = 0.65; - -$DEBUG = 0; - -sub TIEHASH -{ - my ($package, %args) = @_; - my $cache = $args{HASH} || {}; - - # Convert the CACHE to a referenced hash for quick lookup - # - if( $args{CACHE} ) - { - my %hash; - $args{CACHE} = [ $args{CACHE} ] unless ref $args{CACHE} eq "ARRAY"; - foreach my $value ( @{$args{CACHE}} ) - { - $hash{$value} = 1; - } - $args{CACHE} = \%hash; - } - - # Convert the DUMP list to a referenced hash for quick lookup - # - if( $args{DUMP} ) - { - my %hash; - $args{DUMP} = [ $args{DUMP} ] unless ref $args{DUMP} eq "ARRAY"; - foreach my $value ( @{$args{DUMP}} ) - { - $hash{$value} = 1; - } - $args{DUMP} = \%hash; - } - - if ($args{TIE}) - { - my ($module, @opts) = @{$args{TIE}}; - my $modulefile = $module . '.pm'; - $modulefile =~ s{::}{/}g; - eval { require $modulefile }; - if ($@) { - die "Memoize::Saves: Couldn't load hash tie module `$module': $@; aborting"; - } - my $rc = (tie %$cache => $module, @opts); - unless ($rc) { - die "Memoize::Saves: Couldn't tie hash to `$module': $@; aborting"; - } - } - - $args{C} = $cache; - bless \%args => $package; -} - -sub EXISTS -{ - my $self = shift; - my $key = shift; - - if( exists $self->{C}->{$key} ) - { - return 1; - } - - return 0; -} - - -sub FETCH -{ - my $self = shift; - my $key = shift; - - return $self->{C}->{$key}; -} - -sub STORE -{ - my $self = shift; - my $key = shift; - my $value = shift; - - # If CACHE defined and this is not in our list don't save it - # - if(( defined $self->{CACHE} )&& - ( ! defined $self->{CACHE}->{$value} )) - { - print "$value not in CACHE list.\n" if $DEBUG; - return; - } - - # If DUMP is defined and this is in our list don't save it - # - if(( defined $self->{DUMP} )&& - ( defined $self->{DUMP}->{$value} )) - { - print "$value in DUMP list.\n" if $DEBUG; - return; - } - - # If REGEX is defined we will store it only if its true - # - if(( defined $self->{REGEX} )&& - ( $value !~ /$self->{REGEX}/ )) - { - print "$value did not match regex.\n" if $DEBUG; - return; - } - - # If we get this far we should save the value - # - print "Saving $key:$value\n" if $DEBUG; - $self->{C}->{$key} = $value; -} - -1; - -# Documentation -# - -=head1 NAME - -Memoize::Saves - Plug-in module to specify which return values should be memoized - -=head1 SYNOPSIS - - use Memoize; - - memoize 'function', - SCALAR_CACHE => [TIE, Memoize::Saves, - CACHE => [ "word1", "word2" ], - DUMP => [ "word3", "word4" ], - REGEX => "Regular Expression", - HASH => $cache_hashref, - ], - -=head1 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]); - -=head1 CAVEATS - -This module is experimental, and may contain bugs. Please report bugs -to C. - -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. - - -=head1 AUTHOR - -Joshua Gerth - -=head1 SEE ALSO - -perl(1) - -L - - - diff --git a/pod/perlmodlib.pod b/pod/perlmodlib.pod index 5da2564..67ea1a3 100644 --- a/pod/perlmodlib.pod +++ b/pod/perlmodlib.pod @@ -647,10 +647,6 @@ Glue to provide EXISTS for NDBM_File for Storable use Glue to provide EXISTS for SDBM_File for Storable use -=item Memoize::Saves - -Plug-in module to specify which return values should be memoized - =item Memoize::Storable Store Memoized data in Storable database diff --git a/pod/perltoc.pod b/pod/perltoc.pod index 617ed23..088513b 100644 --- a/pod/perltoc.pod +++ b/pod/perltoc.pod @@ -2277,6 +2277,8 @@ UTF-32, UTF-32BE, UTF32-LE, UCS-2, UCS-4, UTF-7 =item Unicode in Perl on EBCDIC +=item Using Unicode in XS + =back =item SEE ALSO @@ -2523,11 +2525,11 @@ Locale::Country, Locale::Currency, Locale::Language, Locale::Maketext, Locale::Maketext::TPJ13, Math::BigFloat, Math::BigInt, Math::BigInt::Calc, Math::Complex, Math::Trig, Memoize, Memoize::AnyDBM_File, Memoize::Expire, Memoize::ExpireFile, Memoize::ExpireTest, Memoize::NDBM_File, -Memoize::SDBM_File, Memoize::Saves, Memoize::Storable, NDBM_File, NEXT, -Net::Cmd, Net::Config, Net::Domain, Net::FTP, Net::NNTP, Net::Netrc, -Net::POP3, Net::Ping, Net::SMTP, Net::Time, Net::hostent, Net::libnetFAQ, -Net::netent, Net::protoent, Net::servent, O, ODBM_File, Opcode, POSIX, -PerlIO, Pod::Checker, Pod::Find, Pod::Html, Pod::InputObjects, Pod::LaTeX, +Memoize::SDBM_File, Memoize::Storable, NDBM_File, NEXT, Net::Cmd, +Net::Config, Net::Domain, Net::FTP, Net::NNTP, Net::Netrc, Net::POP3, +Net::Ping, Net::SMTP, Net::Time, Net::hostent, Net::libnetFAQ, Net::netent, +Net::protoent, Net::servent, O, ODBM_File, Opcode, POSIX, PerlIO, +Pod::Checker, Pod::Find, Pod::Html, Pod::InputObjects, Pod::LaTeX, Pod::Man, Pod::ParseLink, Pod::ParseUtils, Pod::Parser, Pod::Plainer, Pod::Select, Pod::Text, Pod::Text::Color, Pod::Text::Overstrike, Pod::Text::Termcap, Pod::Usage, Pod::t::basic, SDBM_File, Safe, @@ -4292,35 +4294,36 @@ G_EVAL, G_NOARGS, G_SCALAR, G_VOID, HEf_SVKEY, HeHASH, HeKEY, HeKLEN, HePV, HeSVKEY, HeSVKEY_force, HeSVKEY_set, HeVAL, HvNAME, hv_clear, hv_delete, hv_delete_ent, hv_exists, hv_exists_ent, hv_fetch, hv_fetch_ent, hv_iterinit, hv_iterkey, hv_iterkeysv, hv_iternext, hv_iternextsv, -hv_iterval, hv_magic, hv_store, hv_store_ent, hv_undef, isALNUM, isALPHA, -isDIGIT, isLOWER, isSPACE, isUPPER, is_utf8_char, is_utf8_string, items, -ix, LEAVE, load_module, looks_like_number, MARK, mg_clear, mg_copy, -mg_find, mg_free, mg_get, mg_length, mg_magical, mg_set, Move, New, newAV, -Newc, newCONSTSUB, newHV, newRV_inc, newRV_noinc, NEWSV, newSV, newSViv, -newSVnv, newSVpv, newSVpvf, newSVpvn, newSVpvn_share, newSVrv, newSVsv, -newSVuv, newXS, newXSproto, Newz, new_vstring, Nullav, Nullch, Nullcv, -Nullhv, Nullsv, ORIGMARK, perl_alloc, perl_clone, perl_construct, -perl_destruct, perl_free, perl_parse, perl_run, PL_modglobal, PL_na, -PL_sv_no, PL_sv_undef, PL_sv_yes, POPi, POPl, POPn, POPp, POPpbytex, POPpx, -POPs, PUSHi, PUSHMARK, PUSHn, PUSHp, PUSHs, PUSHu, PUTBACK, Renew, Renewc, -require_pv, RETVAL, Safefree, savepv, savepvn, SAVETMPS, scan_bin, -scan_hex, scan_oct, sharedsv_find, sharedsv_init, sharedsv_lock, -sharedsv_new, sharedsv_thrcnt_dec, sharedsv_thrcnt_inc, sharedsv_unlock, -sortsv, SP, SPAGAIN, ST, strEQ, strGE, strGT, strLE, strLT, strNE, strnEQ, -strnNE, StructCopy, SvCUR, SvCUR_set, SvEND, SvGETMAGIC, SvGROW, SvIOK, -SvIOKp, SvIOK_notUV, SvIOK_off, SvIOK_on, SvIOK_only, SvIOK_only_UV, -SvIOK_UV, SvIV, SvIVX, SvIVx, SvLEN, SvNIOK, SvNIOKp, SvNIOK_off, SvNOK, -SvNOKp, SvNOK_off, SvNOK_on, SvNOK_only, SvNV, SvNVx, SvNVX, SvOK, SvOOK, -SvPOK, SvPOKp, SvPOK_off, SvPOK_on, SvPOK_only, SvPOK_only_UTF8, SvPV, -SvPVbyte, SvPVbytex, SvPVbytex_force, SvPVbyte_force, SvPVbyte_nolen, -SvPVutf8, SvPVutf8x, SvPVutf8x_force, SvPVutf8_force, SvPVutf8_nolen, -SvPVX, SvPVx, SvPV_force, SvPV_force_nomg, SvPV_nolen, SvREFCNT, -SvREFCNT_dec, SvREFCNT_inc, SvROK, SvROK_off, SvROK_on, SvRV, SvSETMAGIC, -SvSetMagicSV, SvSetMagicSV_nosteal, SvSetSV, SvSetSV_nosteal, SvSTASH, -SvTAINT, SvTAINTED, SvTAINTED_off, SvTAINTED_on, SvTRUE, svtype, SvTYPE, -SVt_IV, SVt_NV, SVt_PV, SVt_PVAV, SVt_PVCV, SVt_PVHV, SVt_PVMG, SvUOK, -SvUPGRADE, SvUTF8, SvUTF8_off, SvUTF8_on, SvUV, SvUVx, SvUVX, sv_2bool, -sv_2cv, sv_2io, sv_2iv, sv_2mortal, sv_2nv, sv_2pvbyte, sv_2pvbyte_nolen, +hv_iterval, hv_magic, hv_store, hv_store_ent, hv_undef, ibcmp_utf8, +isALNUM, isALPHA, isDIGIT, isLOWER, isSPACE, isUPPER, is_utf8_char, +is_utf8_string, items, ix, LEAVE, load_module, looks_like_number, MARK, +mg_clear, mg_copy, mg_find, mg_free, mg_get, mg_length, mg_magical, mg_set, +Move, New, newAV, Newc, newCONSTSUB, newHV, newRV_inc, newRV_noinc, newSV, +NEWSV, newSViv, newSVnv, newSVpv, newSVpvf, newSVpvn, newSVpvn_share, +newSVrv, newSVsv, newSVuv, newXS, newXSproto, Newz, new_vstring, Nullav, +Nullch, Nullcv, Nullhv, Nullsv, ORIGMARK, perl_alloc, perl_clone, +perl_construct, perl_destruct, perl_free, perl_parse, perl_run, +PL_modglobal, PL_na, PL_sv_no, PL_sv_undef, PL_sv_yes, POPi, POPl, POPn, +POPp, POPpbytex, POPpx, POPs, PUSHi, PUSHMARK, PUSHn, PUSHp, PUSHs, PUSHu, +PUTBACK, pv_uni_display, Renew, Renewc, require_pv, RETVAL, Safefree, +savepv, savepvn, SAVETMPS, scan_bin, scan_hex, scan_oct, sharedsv_find, +sharedsv_init, sharedsv_lock, sharedsv_new, sharedsv_thrcnt_dec, +sharedsv_thrcnt_inc, sharedsv_unlock, sortsv, SP, SPAGAIN, ST, strEQ, +strGE, strGT, strLE, strLT, strNE, strnEQ, strnNE, StructCopy, SvCUR, +SvCUR_set, SvEND, SvGETMAGIC, SvGROW, SvIOK, SvIOKp, SvIOK_notUV, +SvIOK_off, SvIOK_on, SvIOK_only, SvIOK_only_UV, SvIOK_UV, SvIV, SvIVx, +SvIVX, SvLEN, SvNIOK, SvNIOKp, SvNIOK_off, SvNOK, SvNOKp, SvNOK_off, +SvNOK_on, SvNOK_only, SvNV, SvNVx, SvNVX, SvOK, SvOOK, SvPOK, SvPOKp, +SvPOK_off, SvPOK_on, SvPOK_only, SvPOK_only_UTF8, SvPV, SvPVbyte, +SvPVbytex, SvPVbytex_force, SvPVbyte_force, SvPVbyte_nolen, SvPVutf8, +SvPVutf8x, SvPVutf8x_force, SvPVutf8_force, SvPVutf8_nolen, SvPVX, SvPVx, +SvPV_force, SvPV_force_nomg, SvPV_nolen, SvREFCNT, SvREFCNT_dec, +SvREFCNT_inc, SvROK, SvROK_off, SvROK_on, SvRV, SvSETMAGIC, SvSetMagicSV, +SvSetMagicSV_nosteal, SvSetSV, SvSetSV_nosteal, SvSTASH, SvTAINT, +SvTAINTED, SvTAINTED_off, SvTAINTED_on, SvTRUE, svtype, SvTYPE, SVt_IV, +SVt_NV, SVt_PV, SVt_PVAV, SVt_PVCV, SVt_PVHV, SVt_PVMG, SvUOK, SvUPGRADE, +SvUTF8, SvUTF8_off, SvUTF8_on, SvUV, SvUVx, SvUVX, sv_2bool, sv_2cv, +sv_2io, sv_2iv, sv_2mortal, sv_2nv, sv_2pvbyte, sv_2pvbyte_nolen, sv_2pvutf8, sv_2pvutf8_nolen, sv_2pv_flags, sv_2pv_nolen, sv_2uv, sv_backoff, sv_bless, sv_catpv, sv_catpvf, sv_catpvf_mg, sv_catpvn, sv_catpvn_flags, sv_catpvn_mg, sv_catpv_mg, sv_catsv, sv_catsv_flags, @@ -4336,16 +4339,16 @@ sv_setnv_mg, sv_setpv, sv_setpvf, sv_setpvf_mg, sv_setpviv, sv_setpviv_mg, sv_setpvn, sv_setpvn_mg, sv_setpv_mg, sv_setref_iv, sv_setref_nv, sv_setref_pv, sv_setref_pvn, sv_setref_uv, sv_setsv, sv_setsv_flags, sv_setsv_mg, sv_setuv, sv_setuv_mg, sv_taint, sv_tainted, sv_true, -sv_unmagic, sv_unref, sv_unref_flags, sv_untaint, sv_upgrade, sv_usepvn, -sv_usepvn_mg, sv_utf8_decode, sv_utf8_downgrade, sv_utf8_encode, -sv_utf8_upgrade, sv_utf8_upgrade_flags, sv_uv, sv_vcatpvfn, sv_vsetpvfn, -THIS, toLOWER, toUPPER, to_utf8_case, utf8n_to_uvchr, utf8n_to_uvuni, -utf8_distance, utf8_hop, utf8_length, utf8_to_bytes, utf8_to_uvchr, -utf8_to_uvuni, uvchr_to_utf8, uvuni_to_utf8, warn, XPUSHi, XPUSHn, XPUSHp, -XPUSHs, XPUSHu, XS, XSRETURN, XSRETURN_EMPTY, XSRETURN_IV, XSRETURN_NO, -XSRETURN_NV, XSRETURN_PV, XSRETURN_UNDEF, XSRETURN_YES, XST_mIV, XST_mNO, -XST_mNV, XST_mPV, XST_mUNDEF, XST_mYES, XS_VERSION, XS_VERSION_BOOTCHECK, -Zero +sv_uni_display, sv_unmagic, sv_unref, sv_unref_flags, sv_untaint, +sv_upgrade, sv_usepvn, sv_usepvn_mg, sv_utf8_decode, sv_utf8_downgrade, +sv_utf8_encode, sv_utf8_upgrade, sv_utf8_upgrade_flags, sv_uv, sv_vcatpvfn, +sv_vsetpvfn, THIS, toLOWER, toUPPER, to_utf8_case, utf8n_to_uvchr, +utf8n_to_uvuni, utf8_distance, utf8_hop, utf8_length, utf8_to_bytes, +utf8_to_uvchr, utf8_to_uvuni, uvchr_to_utf8, uvuni_to_utf8, warn, XPUSHi, +XPUSHn, XPUSHp, XPUSHs, XPUSHu, XS, XSRETURN, XSRETURN_EMPTY, XSRETURN_IV, +XSRETURN_NO, XSRETURN_NV, XSRETURN_PV, XSRETURN_UNDEF, XSRETURN_YES, +XST_mIV, XST_mNO, XST_mNV, XST_mPV, XST_mUNDEF, XST_mYES, XS_VERSION, +XS_VERSION_BOOTCHECK, Zero =item AUTHORS @@ -4819,6 +4822,8 @@ PerlIO_apply_layers(f,mode,layers), PerlIO_binmode(f,ptype,imode,layers), =item Create debugging macros +=item truncate to the people + =back =back @@ -5012,7 +5017,7 @@ I =item PerlIO is Now The Default -=item Signals Are Now Safe +=item Safe Signals =item Unicode Overhaul @@ -6882,14 +6887,6 @@ I, Win9x and C, Compiler/Preprocessor defines =item File Permissions on Cygwin -=item Hard Links on Cygwin - -=item Filetime Granularity on Cygwin - -=item Tainting Checks on Cygwin - -=item /etc/group on Cygwin - =item Script Portability on Cygwin Pathnames, Text/Binary, F<.exe>, chown(), Miscellaneous @@ -13948,23 +13945,6 @@ Storable use =back -=head2 Memoize::Saves - Plug-in module to specify which return values -should be memoized - -=over 4 - -=item SYNOPSIS - -=item DESCRIPTION - -=item CAVEATS - -=item AUTHOR - -=item SEE ALSO - -=back - =head2 Memoize::Storable - store Memoized data in Storable database =over 4