in reply to Renaming a Hash key
Why do you want to rename the key? Copying the value of a hash element into a new one isn't a problem. More complicated structures use a reference as the hash value. The referant stays where it is. This example is for a hash of lists.
my %hash = (tom => ['sally', 'dave', 'jennie'], bertie => ['jean']); $hash{paul} = delete $hash{tom}; foreach (keys %hash) { print "$_ @{$hash{$_}}\n"; }
|
|---|