in reply to array comparison question

Map each array into a hash and test for the existence of the value.
my %array1 = map {$_ => $_}(1,2,5,9,11,12,13); my %array2 = map {$_ => $_}(1,2,5,11,12,13); my %array3 = map {$_ => $_}(1,2,5,7,9,12,13); my %all = map {$_=>$_} (keys %array1, keys %array2, keys %array3); foreach (sort {$a <=> $b} keys %all) { if (exists($array1{$_}) + exists($array2{$_}) + exists($array3{$_} +) == 2) { print "$_\n"; } }