Your second for loop should also specify the variable you're using as an iterator:
foreach $number (sort keys %count) {
Otherwise the code looks fine.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: counting elements using a hash
by roboticus
in thread counting elements using a hash
by bk1388
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |