Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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
Replies are listed 'Oldest First'.

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 examining the Monastery: (15)
As of 2015-07-07 16:35 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 (91 votes), past polls