Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Printing keys from a hash by value?

by aaron_baugher (Curate)
on Jan 30, 2012 at 20:28 UTC ( [id://950836]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %hash = ('one' => 1, 'two' => 2, 'three' => 3, 'four-minus-one' => 
    +3);
    my %newhash = reverse %hash;
    # %newhash now contains (1 => 'one', 2 => 'two', 3 => 'four-minus-one'
    +)
    # or
    # (1 => 'one', 2 => 'two', 3 => 'three')
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found