in reply to Renaming a Hash key

A hash key isn't just a name, it is used to calculate the location of the value. If you could change the name then you would effectively be copying and deleting.

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"; }