use warnings; use strict; use List::Compare; my @S1 = ( 'G1', 'G3', 'G5' ); my @S2 = ( 'G1', 'G3', 'G5', 'G7', 'G12' ); my @S3 = ( 'G1', 'G5' ); my @A = ('\@S1', '\@S2', '\@S3'); my $var = join ',' , @A; my $lc = List::Compare->new('--unsorted', "$var"); my @intersection = $lc->get_intersection; print "intesection is @intersection\n";