$yourHashName{$b} <=> $yourHashName{$a}; #### foreach $key (sort (keys(%yourHashName))) { print "\t\t$key \t $yourHashName{$key}\n"; }