Why not use for in this example, since you're not really transforming @items into a new array (common use of map), but rather just performing an action for each value in @items (common use of for).
$bag->{$_}++ for @items; # instead of map {$bag->{$_}++} @items;
-Bryan
In reply to Re^2: Using map to create a hash/bag from an array
by mrborisguy
in thread Using map to create a hash/bag from an array
by spurperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |