in reply to sorting question

thekestrel,
By default, sort uses the cmp operator. Since you want numerical comparison, you need to use the numerical counterpart <=>(spaceship operator).
print "$_\n" for sort { $a <=> $b } values %hash;

Cheers - L~R