#!/usr/bin/perl use strict; use warnings; my %hash = (); while (my $line = ){ chomp $line; my ($k, $v) = split / /, $line; # geƤnderte zeile $hash{$k} = $v if(!exists($hash{$k}) or $hash{$k} < $v); } my @keys_sorted = sort{ $hash{$b} <=> $hash{$a} }keys %hash; for my $key ( @keys_sorted ){ print "$key -> $hash{$key}\n"; } __DATA__ woche 4 woche 3 week 2 semana 1 woche 7 week 4 semana 9 vecka 3