in reply to Re: Preserve the value of original array
in thread Preserve the value of original array

Thanks, bobf

I need to pass the array as a reference because I'm passing more than one value. My example was simplified to make my question simpler.

  • Comment on Re^2: Preserve the value of original array

Replies are listed 'Best First'.
Re^3: Preserve the value of original array
by ayrnieu (Beadle) on Feb 14, 2006 at 07:01 UTC

    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 }