C:\>perl my @array = qw/a b d/; my %hash = qw/a 0 b 3 d 1/; local $, = ','; print sort { $hash{$b} <=> $hash{$a} } @array; _ _END_ _ b,d,a C:\>