@a=qw( one two three for five six seven eight nine ten eleven); @hash{@a}=(0..$#a); @sorted=sort { $hash{$a}<=>$hash{$b} } keys %hash;