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

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

by Punitha (Priest)
on Jan 07, 2008 at 06:10 UTC ( #660764=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    
    ...
            print "KEY:$key\n";
        }
    }
    
  2. or download this
    my %myhash = { 1 => 'a', 2=> 'b', 3=> 'a', 4=>'c'};
    
  3. or download this
    use strict;
    my $myhash = { 1 => 'a', 2=> 'b', 3=> 'a', 4=>'c'};
    for my $key (keys %{$myhash}){
    ...
            print "KEY:$key\n";
        }
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2020-08-05 05:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (35 votes). Check out past polls.

    Notices?