Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Code requested for array intersection count

by Fletch (Bishop)
on Jun 09, 2003 at 15:25 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://264353]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-29 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found