in reply to Re^2: Preserve the value of original array
in thread Preserve the value of original array
It's a little bit harder to answer when your example is thus simplified. It looks like you got your answer, anyway.
(I might've suggested:)
sub second { my $sum = 0; $sum += $_ for 6, @{+shift}; $sum }
|
|---|