Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: How to get Keys from hash having same value?

by shmem (Chancellor)
on Jan 07, 2008 at 14:19 UTC ( [id://660833]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    %newhash = reverse do { my $hash = reverse %myhash; %hash };
    
  2. or download this
    @unique_keys = do { my $hash = reverse %myhash; values %hash };
    
  3. or download this
    %myhash = (1 => 'a', 2=> 'b', 3=> 'a', 4=>'c',5 => 'b', 6 => 'a');
    @k = do {
    ...
    3 => a
    2 => b
    5 => b
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-04-24 12:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found