The default collating sequence for sort is ASCII (cmp). If you want something different, you have to tell sort how to compare two items.
foreach $number (sort {$a <=> $b} (keys(%name))) {
--
Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)
In reply to Re: sorting a hash by key
by rinceWind
in thread sorting a hash by key
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |