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;
In reply to Re: optimal way of comparing 2 arrays
by chester
in thread optimal way of comparing 2 arrays
by narashima
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |