If the answer to the first question is "no" or if the answer to the second one is "yes", this will work:
my @merged = sort { $a <=> $b } keys %{ { map { $_ => 1 } } } @A, @B;
If order isn't an issue simply remove the sort { $a <=> $b } bit.
In reply to Re: Merging Arrays without duplicates
by gaal
in thread Merging Arrays without duplicates
by perl_krish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |