]> git.vpit.fr Git - perl/modules/Sub-Prototype-Util.git/blobdiff - lib/Sub/Prototype/Util.pm
Make flatten() die if not enough arugments were provided to match the given prototype
[perl/modules/Sub-Prototype-Util.git] / lib / Sub / Prototype / Util.pm
index 20525ece0971b354170d655b1ce89b344100467c..316d079bbe85590ba6c35996ae25afb76bc54db5 100644 (file)
@@ -93,9 +93,8 @@ sub flatten {
   } elsif ($p =~ /[\@\%]/) {
    push @args, @_;
    last;
-  } elsif ($p eq '_') {
-   shift; # without prototype, this argument wouldn't have been passed
   } else {
+   croak 'Not enough arguments to match this prototype' unless @_;
    push @args, shift;
   }
  }