Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 rifling through the Monastery: (2)
As of 2020-08-05 05:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (35 votes). Check out past polls.

    Notices?