You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
341 B
Raku

@a = (1, 2, 3);
@b = (4, 5, 6);
sub addem
{
my ($reference1, $reference2) = @_;
for ($loop_index = 0; $loop_index <= $#$reference1; $loop_index++) {
$result[$loop_index] = @$reference1[$loop_index] + @$reference2[$loop_index];
}
return @result;
}
@array = addem (\@a, \@b);
print join (', ', @array);