This shows you the differences between two versions of the page.
— |
kurs:hash_by_value_sortieren [2014/09/10 21:22] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <code> | ||
+ | @keys = sort keys %hash; # sorted by key | ||
+ | @keys = sort { | ||
+ | $hash{$a} cmp $hash{$b} | ||
+ | } keys %hash; # and by value | ||
+ | </code> |