in reply to
sorting a hash by key
You're sorting alphatically. Use
foreach $number (sort { $a <=> $b } keys(%name)) {
to sort numerically.
Comment on
Re: sorting a hash by key
Download
Code
In Section
Seekers of Perl Wisdom