more useful options | |
PerlMonks |
Re: += a hash slice?by kroach (Pilgrim) |
on Jun 01, 2015 at 12:48 UTC ( [id://1128557]=note: print w/replies, xml ) | Need Help?? |
How about something like this?
The map will add the first element of @plus to each element of the slice in order. However, since the first element gets shifted, $totals{a} gets incremented by 1, $totals{b} by 2 and $totals{c} by 3.
In Section
Seekers of Perl Wisdom
|
|