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!
In reply to Re: Modifying the keys in a hash
by Sidhekin
in thread Modifying the keys in a hash
by Mandrake
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |