in reply to Re: Using += in array context
in thread Using += in array context

Personally, I'd use the foreach code from the original question. I find it clearer and cleaner than even the "wish" code. For one thing, "@fields" doesn't have to be repeated in that code.

If grinder finds     $totals{$_} += $delta{$_} foreach( @fields ); "ugly", then I doubt

use mapcar; mapcar { $_[0] += $_[1] } [@totals{@fields}], [@delta{@fields}];
would fair any better.

        - tye (but my friends call me "Tye")