Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: optimal way of comparing 2 arrays

by chester (Hermit)
on Oct 19, 2005 at 19:57 UTC ( #501400=note: print w/ replies, xml ) Need Help??


in reply to optimal way of comparing 2 arrays

use warnings; use strict; use List::Compare; use Data::Dumper; my @file1 = qw{1 2 3 4 }; my @file2 = qw{ 2 3 4 5}; my $lc = List::Compare->new( { lists => [\@file1, \@file2], } ); my @intersection = $lc->get_intersection(); my @file1_only = $lc->get_Lonly(); my @file2_only = $lc->get_Ronly(); print Dumper \@intersection, \@file1_only, \@file2_only;


Comment on Re: optimal way of comparing 2 arrays
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2014-07-10 07:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (202 votes), past polls