Permalink
Browse files

import Memoize 0.61 from CPAN

git-cpan-module:   Memoize
git-cpan-version:  0.61
git-cpan-authorid: MJD
git-cpan-file:     authors/id/M/MJ/MJD/Memoize-0.61.tar.gz
  • Loading branch information...
1 parent 45a353b commit f3eca918436512ea8bf7f961d196714a2b8dbe88 @mjdominus committed with schwern Oct 24, 2000
Showing with 45 additions and 2 deletions.
  1. +1 −0 MANIFEST
  2. +2 −2 Memoize.pm
  3. +42 −0 t/flush.t
View
@@ -27,6 +27,7 @@ t/expire.t
t/expire_module_n.t
t/expire_module_t.t
t/expire_file.t
+t/flush.t
article.html
demo.pl
demo2.pl
View
@@ -8,10 +8,10 @@
# same terms as Perl itself. If in doubt,
# write to mjd-perl-memoize+@plover.com for a license.
#
-# Version 0.52 beta $Revision: 1.14 $ $Date: 1999/09/17 14:55:57 $
+# Version 0.61 beta $Revision: 1.17 $ $Date: 2000/10/24 04:33:49 $
package Memoize;
-$VERSION = '0.60';
+$VERSION = '0.61';
# Compile-time constants
sub SCALAR () { 0 }
View
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+
+use lib '..';
+use Memoize 'flush_cache', 'memoize';
+print "1..8\n";
+print "ok 1\n";
+
+
+
+my $V = 100;
+sub VAL { $V }
+
+memoize 'VAL';
+print "ok 2\n";
+
+my $c1 = VAL();
+print (($c1 == 100) ? "ok 3\n" : "not ok 3\n");
+
+$V = 200;
+$c1 = VAL();
+print (($c1 == 100) ? "ok 4\n" : "not ok 4\n");
+
+flush_cache('VAL');
+$c1 = VAL();
+print (($c1 == 200) ? "ok 5\n" : "not ok 5\n");
+
+$V = 300;
+$c1 = VAL();
+print (($c1 == 200) ? "ok 6\n" : "not ok 6\n");
+
+flush_cache(\&VAL);
+$c1 = VAL();
+print (($c1 == 300) ? "ok 7\n" : "not ok 7\n");
+
+$V = 400;
+$c1 = VAL();
+print (($c1 == 300) ? "ok 8\n" : "not ok 8\n");
+
+
+
+
+

0 comments on commit f3eca91

Please sign in to comment.