my $count = 0; %hash = map { $count++ => $a{$_} } sort { $a <=> $b } keys %hash; [download]
In reply to Re^2: re-key a hash by brool in thread re-key a hash by Anonymous Monk