in reply to Sort assoc array

Like ChrisR above, but this will let you get the values sorted.

First, numerically:

for my $x(sort {return $hash{$a} <=> $hash{$b}} keys %hash) { print "$x = $hash{$x}\n"; }
and now lexicographically
for my $x(sort {return $hash{$a} cmp $hash{$b}} keys %hash) { print "$x = $hash{$x}\n"; }