Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Code requested for array intersection count

by Fletch (Chancellor)
on Jun 09, 2003 at 15:25 UTC ( #264353=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %wanted = map { $_, 1 } @array_1;
    my $bag = Set::Bag->new( );
    foreach( @array_2 ) {
      $bag->insert( $_ => 1 ) if $wanted{ $_ };
    }
    

Log In?
Username:
Password:

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

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










    Results (75 votes). Check out past polls.

    Notices?