in reply to sorting a hash

You may want to see
perldoc -q sort
perldoc -f sort
from the command line.