123456789101112
use strict;my %hash = ();open (AN, '<', $ARGV[0] ) or die "$!\n";while (my $line = <AN>) { chomp $line; my ($k, $v) = split / /, $line; $hash{$k} = $v; }my @keys_sorted = sort{ $hash{$b} <=> $hash{$a} }keys %hash; for my $key ( @keys_sorted ) { print "$key -> $hash{$key}\n"; }