foreach (@a) { $hash{$a}++; }
@key = keys %hash;
foreach (@key) { print "$_ found $hash{$_} times\n";}
Question: How can I populate the hash without a loop? @hash{@a} = (1) x @a;
doesnt really work to create a count of duplicate hash items.
In reply to How can I populate a hash? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |