Whilst recent versions of Perl do away with the memory problems of using map in a void context, it still seems strange to me to use map purely for its side effects. Particularly when for usually works just as well.
$count->{$_}++ for @a;
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re^2: extract number of times a value appears in an array
by davorg
in thread extract number of times a value appears in an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |