Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How do I modify the KEYS in a hash (copy)

by sen (Hermit)
on Feb 06, 2008 at 14:42 UTC ( [id://666568]=note: print w/replies, xml ) Need Help??


in reply to How do I modify the KEYS in a hash (copy)

Here is another way to modify the keys.

my %Orig=('a b'=>44, 'c d'=>22, rr=>99); my %Copy = map { $_ => $_=~ s/ /_/ } keys %Orig; print qq(C: $_ => $Copy{$_}\n) for keys %Copy;

Originally posted as a Categorized Answer.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2026-01-14 10:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.