That is jumping through some hoops to avoid void.Well, yeah. I was posting them in sort of a humor/brainteaser vein rather than as a serious solution to a problem that is (as has been pointed out)
Incidentally, here's a method that benches about 9% faster than for_loop:
sub new_guy { my %sums; ++$_ for @sums{@array}; }
In reply to Re^4: Counting unique elements in an array
by Roy Johnson
in thread Counting unique elements in an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |