Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by Punitha (Priest)
on Jan 07, 2008 at 06:10 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://660764]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-18 22:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found