Flattens the array C<@args> according to the prototype C<$proto>. When C<@args> is what C<@_> is after calling a subroutine with prototype C<$proto>, C<flatten> returns the list of what C<@_> would have been if there were no prototype.
=head2 C<flatten $proto, @args>
Flattens the array C<@args> according to the prototype C<$proto>. When C<@args> is what C<@_> is after calling a subroutine with prototype C<$proto>, C<flatten> returns the list of what C<@_> would have been if there were no prototype.
@@ -139,9+145,8 @@ For example, this allows you to recall into C<CORE::grep> and C<CORE::map> by us
sub _wrap {
my ($name, $proto, $i, $args, $cr, $opts) = @_;
sub _wrap {
my ($name, $proto, $i, $args, $cr, $opts) = @_;
- if ($proto =~ /(\\?)(\[[^\]]+\]|[^\];])(.*)/g) {
+ while ($proto =~ s/(\\?)(\[[^\]]+\]|[^\];])//) {