Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: help with a function that will cut out redundancy across two lists

by dorko (Parson)
on May 20, 2011 at 13:48 UTC ( #905926=note: print w/ replies, xml ) Need Help??


in reply to help with a function that will cut out redundancy across two lists

List::Compare does that and more:

use List::Compare; use Data::Dumper; @Llist = qw(abel abel baker camera delta edward fargo golfer); @Rlist = qw(baker camera delta delta edward fargo golfer hilton); $lc = List::Compare->new(\@Llist, \@Rlist); #Get those items which appear at least once in both lists (their inter +section). @intersection = $lc->get_intersection; print Dumper \@intersection;

Cheers,

Brent

-- Yeah, I'm a Delt.


Comment on Re: help with a function that will cut out redundancy across two lists
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2014-08-31 02:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls