[ create a new paste ] login | about

Link: http://codepad.org/dRkHNzJM    [ raw code | output | fork ]

Perl, pasted on Dec 20:
1
2
3
4
5
$hash = { "ほげ" => 10, "ふが" => 5, "ぴき" => 30 };

for my $key (sort { $hash->{$b} <=> $hash->{$a} } keys %$hash) {
    print $key, ",", $hash->{$key}, "\n";
}


Output:
1
2
3
ぴき,30
ほげ,10
ふが,5


Create a new paste based on this one


Comments: