in reply to Hashes: Obtaining the Key Value for a Given Value Value

I think you just want to sort the keys based on the values:
for my $k (sort { $hash{$a} <=> $hash{$b} } keys %hash) { print "$k: $hash{$k}\n"; }
There's a module, Sort::Key, for doing it faster, though it likely won't matter.

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Hashes: Obtaining the Key Value for a Given Value Value
by o2bwise (Scribe) on Feb 20, 2006 at 19:59 UTC
    Thanks, Roy.

    I used your snippet of code. That's sweet!

    I'm all set.

    Tony