#!/usr/bin/perl use strict; use warnings; my @arrayONE = ("rabbits", "horses", "oranges"); my @arrayTWO = ("truck", "boat", "oranges"); for (my $x = 0; $x <= $#arrayONE; $x += 1) { for (@arrayTWO) { print STDERR "SHARED: $_\n" if $arrayONE[$x] eq "$_"; } }