Upgrade to Math::BigInt 1.86
[p5sagit/p5-mst-13.2.git] / lib / Tie / Memoize.pm
index 0b3d320..dbe1442 100644 (file)
@@ -2,6 +2,7 @@ use strict;
 package Tie::Memoize;
 use Tie::Hash;
 our @ISA = 'Tie::ExtraHash';
+our $VERSION = '1.1';
 
 our $exists_token = \undef;
 
@@ -29,11 +30,11 @@ sub EXISTS   {
   my $cache = $a->[1]{$key};
   return $cache if defined $cache; # Existence cache
   my @res = $a->[3]($key,$a->[4]);
-  $_[0][1]{$key} = 0, return unless @res; # Cache non-existence
+  $a->[1]{$key} = 0, return unless @res; # Cache non-existence
   # Now we know it exists
-  return ($_[0][1]{$key} = 1) if $a->[5]; # Only existence reported
+  return ($a->[1]{$key} = 1) if $a->[5]; # Only existence reported
   # Now know the value
-  $_[0][0]{$key} = $res[0];    # Store data
+  $a->[0]{$key} = $res[0];    # Store data
   return 1
 }
 
@@ -50,7 +51,7 @@ sub TIEHASH  {
 
 =head1 NAME
 
-Tiel::Memoize - add data to hash when needed
+Tie::Memoize - add data to hash when needed
 
 =head1 SYNOPSIS