This is a question about code that already works! I have lots subroutines that take multiple arrays as inputs, such as:
use 5.24.0;
use feature 'refaliasing';
no warnings "experimental::refaliasing";
my (@foo,@bar,@baz);
sub sumarr (\@\@);
# other code to load arrays
sub sumarr (\@\@)
{ my (@sum, @aa, @ab);
(\@aa,\@ab)=@_;
$sum[$_] = $aa[$_] + $ab[$_] for 0 .. $#aa;
return @sum;
}
...which I can call simply with
@baz = sumarr( @foo, @bar);
I haven't found any way to either replace the prototype with signatures, or at least augment the prototype with a signature for streamlining the argument list. Is there anything that does that yet?