my $hash = $obj->{HASH} || {}; foreach my $key ( sort {$hash->{$b} <=> $hash->{$a} } keys %{$hash} ) { print $key, "\n"; }