use strict; my %hash = ("woche1" => "4", "woche2" => "3", "woche3" => "1", "woche4" => "7", "woche5" => "2"); my @keys_sorted = sort{ $hash{$b} <=> $hash{$a} }keys %hash; for my $key ( @keys_sorted ) { print "$key -> $hash{$key}\n"; }