Use <=> with a numeric sort, cmp with strings. See sort.
Additionally, the reason repeated occurances aren't being printed is because you're using the occurance as the hash key. Given the above implementation you probably want to use an array instead of a hash.
In reply to Re: Problem with sorting numbers.
by eibwen
in thread Problem with sorting numbers.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |