in reply to Modifying the keys in a hash

No other way. Sorry. However, you can make it less clumsy (at least avoid repeating $hash{'key1'}) by using the return value from delete:

$hash{'key2'} = delete $hash{'key1'};

print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!

Replies are listed 'Best First'.
Re^2: Modifying the keys in a hash
by Mandrake (Chaplain) on Feb 23, 2007 at 11:24 UTC
    Thanks for the reply.