%hash = map { ($_, $hash{(sort keys %hash)[$_]}) } 0..keys(%hash)-1; [download]
In reply to Re^2: re-key a hash by Roy Johnson in thread re-key a hash by Anonymous Monk