]> git.vpit.fr Git - perl/modules/Sub-Prototype-Util.git/blobdiff - lib/Sub/Prototype/Util.pm
_ shouldn't push elements in flatten, but skip them
[perl/modules/Sub-Prototype-Util.git] / lib / Sub / Prototype / Util.pm
index c5c6ffd94294b2dbb04041e136a765604f107736..a92647f6a4d224985ff72ac11dea3fd75ed980ca 100644 (file)
@@ -87,8 +87,8 @@ sub flatten {
   } elsif ($p =~ /[\@\%]/) {
    push @args, @_;
    last;
-  } elsif ($p eq '_' && @_ == 0) {
-   push @args, $_;
+  } elsif ($p eq '_') {
+   shift; # without prototype, this argument wouldn't have been passed
   } else {
    push @args, shift;
   }