in reply to Sort assoc array
First, numerically:
and now lexicographicallyfor my $x(sort {return $hash{$a} <=> $hash{$b}} keys %hash) { print "$x = $hash{$x}\n"; }
for my $x(sort {return $hash{$a} cmp $hash{$b}} keys %hash) { print "$x = $hash{$x}\n"; }
|
|---|