Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Code requested for array intersection count

by ChOas (Curate)
on Jun 11, 2003 at 10:21 UTC ( #264996=note: print w/ replies, xml ) Need Help??


in reply to Code requested for array intersection count

And just to do it one more different way :)

#!/usr/bin/perl -w use strict; my @array_1 = qw/A B X/; my @array_2 = qw/A B C D A D B A C/; my %Seen; ++$Seen{$_} for @array_2; print "$_ : ",exists $Seen{$_}||0,"\n" for @array_1

GreetZ!,
    ChOas

print "profeth still\n" if /bird|devil/;


Comment on Re: Code requested for array intersection count
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2015-07-03 07:26 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 (48 votes), past polls