X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FSub-Prototype-Util.git;a=blobdiff_plain;f=lib%2FSub%2FPrototype%2FUtil.pm;h=2e2a5045a6f9fafadfb35492e42bfba9f7c0984c;hp=661d03d71cb1354f1c13f28a15f6e08c71fa2e37;hb=60e38805350346d06fe27a7dee61932e0da22413;hpb=5e934b02978f8e2a411e8aba352fc6465c0e3aba diff --git a/lib/Sub/Prototype/Util.pm b/lib/Sub/Prototype/Util.pm index 661d03d..2e2a504 100644 --- a/lib/Sub/Prototype/Util.pm +++ b/lib/Sub/Prototype/Util.pm @@ -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 . ']';