in reply to Sort Hash Values Alphabetically

Per kennethk's suggested reference, here's one way that's pretty straight-forward:

use strict; use warnings; my %hash = ( 5328 => 'High', 26191 => 'Very High', 57491 => 'Low', 4915 => 'High', 1499 => 'Very High', 999 => 'Low', 4323 => 'Average', 4314 => 'High', ); print "$_ => $hash{$_}\n" foreach(sort{$hash{$a} cmp $hash{$b}} keys %hash);

Which yields the output that I think you're looking for:

4323 => Average 4314 => High 5328 => High 4915 => High 57491 => Low 999 => Low 1499 => Very High 26191 => Very High

The sort doesn't care that you have duplicate entries, it treats them as eq in the cmp and doesn't change their order within the duplicates...but it does group the duplicates and puts the group in the right place in the sort.

Good luck.

ack Albuquerque, NM