use strict; use warnings; use List::Compare; my @mammals = qw/dog cat mouse horse planet/; my @sky = qw/star planet galaxy nova comet/; my $lc = List::Compare->new( \@mammals, \@sky ); my @intersection = $lc->get_intersection; print "@intersection", "\n"; # prints "planet" print scalar @intersection, "\n"; # prints 1 my @arr1 = 0 .. 5; my @arr2 = 6 .. 10; $lc = List::Compare->new( \@arr1, \@arr2 ); @intersection = $lc->get_intersection; print "@intersection", "\n"; # prints "" print scalar @intersection, "\n"; # prints 0