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)}};
In reply to Re: Merging Arrays without duplicates
by rsteinke
in thread Merging Arrays without duplicates
by perl_krish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |