Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Common hash keys

by FunkyMonk (Canon)
on Jun 07, 2008 at 10:41 UTC ( #690825=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    DB<2> $seen{$_}++ for (keys(%a), keys(%b))
    DB<3> x grep { $seen{$_} > 1 } keys(%seen)
    
  2. or download this
    use Data::Dump;
    
    ...
    
    my %seen;
    pp grep { $seen{$_}++ } keys %a, keys %b;
    
  3. or download this
    pp grep { state %seen; $seen{$_}++ } keys %a, keys %b;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2015-07-28 06:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls