foreach (@array1, @array2) { push(@array3, $_) unless $seen{$_}++; }