Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: can I change hash keys or values directly

by jwkrahn (Abbot)
on Jan 28, 2021 at 21:35 UTC ( [id://11127608]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -le'my %x = "A" .. "F"; print "@{[ %x ]}"; $_ = lc for %x; prin
    +t "@{[ %x ]}";'
    C D A B E F
    C d A b E f
    
  2. or download this
    $ perl -le'my %x = "A" .. "F"; print "@{[ %x ]}"; $x{ lc() } = delete 
    +$x{ $_ } for keys %x; print "@{[ %x ]}";'
    E F A B C D
    c D a B e F
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-25 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found