Thread Problem mit einem Hash of Hashes
(10 answers)
Opened by Dingels at 2008-12-11 19:09 Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 my %max; for my $type (keys %hash) { my $values = $hash{$type}; my $max = (sort { $values->{$b} <=> $values->{$a} } keys %$values )[0]; $max{$type} = "$max $values->{$max}"; } print Dumper \%max; Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wie frage ich & perlintro brian's Leitfaden für jedes Perl-Problem |