my %intermediateHash; $intermediateHash{$_}++ for (@array1, @array2); my @array3 = keys %intermediateHash;