- or download this
sub split_array_in_two { ([splice @_, @_/2], \@_)[1,0] }
- or download this
sub split_array_in_two { my $l=@_/2; [@_[0..$l-1]], [@_[$l..$#_]] }
- or download this
sub da (\@\@\@) {
my ($s, $a, $b)=@_;
...
my @s=1..7;
da(@s, @a, @b);
print "@a - @b\n"