in reply to Building list::comapre objects for unknown numbers of objects
As the documentation shows, you need to pass listrefs, not a string.
use strict; use warnings; 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 $lc = List::Compare->new('--unsorted', @A); my @intersection = $lc->get_intersection; print "intesection is @intersection\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Building List::Compare objects for unknown numbers of objects
by biologistatsea (Acolyte) on Nov 21, 2018 at 12:08 UTC | |
by hippo (Archbishop) on Nov 21, 2018 at 14:13 UTC |