From 12679ab7d3c2a210f4123163671b532b8b55d5f9 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 15 Mar 2024 03:06:35 +0000 Subject: CTAN sync 202403150306 --- .../tlnet/tlpkg/tlperl/lib/Memoize/SDBM_File.pm | 80 +++++----------------- 1 file changed, 16 insertions(+), 64 deletions(-) (limited to 'systems/texlive/tlnet/tlpkg/tlperl/lib/Memoize/SDBM_File.pm') diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Memoize/SDBM_File.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Memoize/SDBM_File.pm index 7cfaa4afb9..87ef28e1ef 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Memoize/SDBM_File.pm +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Memoize/SDBM_File.pm @@ -1,75 +1,27 @@ -package Memoize::SDBM_File; - -=head1 NAME - -Memoize::SDBM_File - glue to provide EXISTS for SDBM_File for Storable use - -=head1 DESCRIPTION - -See L. - -=cut +use strict; use warnings; -use SDBM_File; -@ISA = qw(SDBM_File); -$VERSION = '1.03'; - -$Verbose = 0; - -sub AUTOLOAD { - warn "Nonexistent function $AUTOLOAD invoked in Memoize::SDBM_File\n"; -} - -sub import { - warn "Importing Memoize::SDBM_File\n" if $Verbose; -} +package Memoize::SDBM_File; +our $VERSION = '1.16'; +use SDBM_File 1.01; # for EXISTS support +our @ISA = qw(SDBM_File); -my %keylist; +1; -# This is so ridiculous... -sub _backhash { - my $self = shift; - my %fakehash; - my $k; - for ($k = $self->FIRSTKEY(); defined $k; $k = $self->NEXTKEY($k)) { - $fakehash{$k} = undef; - } - $keylist{$self} = \%fakehash; -} +__END__ -sub EXISTS { - warn "Memoize::SDBM_File EXISTS (@_)\n" if $Verbose; - my $self = shift; - _backhash($self) unless exists $keylist{$self}; - my $r = exists $keylist{$self}{$_[0]}; - warn "Memoize::SDBM_File EXISTS (@_) ==> $r\n" if $Verbose; - $r; -} +=pod -sub DEFINED { - warn "Memoize::SDBM_File DEFINED (@_)\n" if $Verbose; - my $self = shift; - _backhash($self) unless exists $keylist{$self}; - defined $keylist{$self}{$_[0]}; -} +=head1 NAME -sub DESTROY { - warn "Memoize::SDBM_File DESTROY (@_)\n" if $Verbose; - my $self = shift; - delete $keylist{$self}; # So much for reference counting... - $self->SUPER::DESTROY(@_); -} +Memoize::SDBM_File - DEPRECATED compability shim -# Maybe establish the keylist at TIEHASH time instead? +=head1 DESCRIPTION -sub STORE { - warn "Memoize::SDBM_File STORE (@_)\n" if $VERBOSE; - my $self = shift; - $keylist{$self}{$_[0]} = undef; - $self->SUPER::STORE(@_); -} +This class used to provide L> support for L +before support for C was added to L itself +L. -# Inherit FETCH and TIEHASH +Any code still using this class should be rewritten to use L directly. -1; +=cut -- cgit v1.2.3