awohld has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use List::Compare; my @primary = qw( 1 2 3 4 ); my @secondary = qw ( 3 4 5); my @another = qw ( 4 5 6 7 ); my %hash; $hash{0} = \@primary; $hash{1} = \@secondary; $hash{2) = \@another; my $lc = List::Compare->new( \@{$hash{0}}, \@{$hash{1}}, \@{$hash{2}} +); # Would like to pass and compare every array in the hash without speci +fying each array in the hash. # my $lc = List::Compare->new( %hash ); # But I can't figure out how to get it to work my @intersection = $lc->get_intersection; print @intersection;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Comparing multiple arrays in Hash of Arrays using List::Compare
by BrowserUk (Patriarch) on Feb 13, 2006 at 22:31 UTC | |
by awohld (Hermit) on Feb 13, 2006 at 22:35 UTC | |
by BrowserUk (Patriarch) on Feb 13, 2006 at 23:08 UTC |