Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by shmem (Chancellor)
on Jan 07, 2008 at 14:19 UTC ( #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
Node Status?
node history
Node Type: note [id://660833]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2020-10-20 23:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (212 votes). Check out past polls.

    Notices?