my %checkHash = (); my @uniq = grep { not $seen{$_}++ } ( @array1, @array2 );