my %temp=map{$_ =>1} @temp; my %temp2=map{$_=>1} @temp2; my @non_unique_intersection = grep( $temp{$_}, @temp2 ); print "----------------------\nThe Non-Unique Intersection of Temp and Temp2 Arrays\n"; print "\t", $_, "\n" foreach (@non_unique_intersection);