in reply to Merging Arrays without duplicates
To remove duplicate elements, use an intermediate hash:
The double %{{}} on the outside are necessary, as the inner pair creates a hash reference, and the outer %{} dereferences it.my @out = keys %{{map {($_ => 1)} (@A, @B)}};
|
---|