in reply to Multiple keys describing a single hash element
First of all, both the old key and the new key should refer to a reference. If $clients{$old_key} is a reference, there's no need to take the address in the assignment to $new_client_hash{$old_key}. On the other hand, if $clients{$old_key} is a value, both assignments to $new_client_hash should be of the address.
I'd do something like
to avoid confusion if $clients{$old_key} holds the value,my $value = $clients{$old_key}; $new_client_hash{$new_key} = \$value; $new_client_hash{$old_key} = \$value;
if it's a reference.$new_client_hash{$new_key} = $clients{$old_key}; $new_client_hash{$old_key} = $clients{$old_key};
Just my 2 cents, -gjb-
|
|---|