#!/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 specifying 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;