sub sort_by_value { my $hash = shift; sort {$hash->{$a} <=> $hash->{$b} } keys %$hash; }