]> git.vpit.fr Git - perl/modules/Sub-Prototype-Util.git/blobdiff - lib/Sub/Prototype/Util.pm
Importing Sub-Prototype-Util-0.03.tar.gz
[perl/modules/Sub-Prototype-Util.git] / lib / Sub / Prototype / Util.pm
index 661d03d71cb1354f1c13f28a15f6e08c71fa2e37..2e2a5045a6f9fafadfb35492e42bfba9f7c0984c 100644 (file)
@@ -12,11 +12,13 @@ Sub::Prototype::Util - Prototype-related utility routines.
 
 =head1 VERSION
 
-Version 0.02
+Version 0.03
 
 =cut
 
-our $VERSION = '0.02';
+use vars qw/$VERSION/;
+
+$VERSION = '0.03';
 
 =head1 SYNOPSIS
 
@@ -78,7 +80,7 @@ sub flatten {
   } elsif ($p =~ /[\@\%]/) {
    push @args, @_;
    last;
-  } elsif ($p eq '_') {
+  } elsif ($p eq '_' && @_ == 0) {
    push @args, $_;
   } else {
    push @args, shift;
@@ -117,7 +119,7 @@ sub recall {
     last;
    } elsif ($p =~ /\&/) {
     push @args, 'sub{&{$a[' . $i . ']}}';
-   } elsif ($p eq '_') {
+   } elsif ($p eq '_' && $i >= @a) {
     push @args, '$_';
    } else {
     push @args, '$a[' . $i . ']';