Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Modifying the keys in a hash

by Sidhekin (Priest)
on Feb 23, 2007 at 10:10 UTC ( [id://601720]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://601720]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-19 23:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found