ここにある例を見ています: http://perlmeme.org/tutorials/sort_function.html
そして、各キーの値に基づいてハッシュをソートする次のコードを提供します。
# Using <=> instead of cmp because of the numbers
foreach my $fruit (sort {$data{$a} <=> $data{$b}} keys %data) {
print $fruit . ": " . $data{$fruit} . "\n";
}
このコードは完全には理解できませんが、試してみると、最低から最高の順に並べ替えられます。最高から最低の順に並べ替えるにはどうすればよいですか?