Add $VERSION to Module::Build::Version
[p5sagit/p5-mst-13.2.git] / lib / Memoize.pm
index cf84542..f14a34a 100644 (file)
@@ -11,7 +11,7 @@
 # Version 1.01 $Revision: 1.18 $ $Date: 2001/06/24 17:16:47 $
 
 package Memoize;
-$VERSION = '1.01_01';
+$VERSION = '1.01_02';
 
 # Compile-time constants
 sub SCALAR () { 0 } 
@@ -266,8 +266,9 @@ sub _memoizer {
       # Otherwise, we cached an array containing the returned list:
       return @$val;
     } else {
-      my $q = $cache->{$argstr} = [&{$info->{U}}(@_)];
-      @$q;
+        my @q = &{$info->{U}}(@_);
+        $cache->{$argstr} = $info->{O}{LIST_CACHE} eq 'MERGE' ? $q [0] : \@q;
+        @q;
     }
   } else {
     croak "Internal error \#42; context was neither LIST nor SCALAR\n";