in reply to Merging Arrays without duplicates

Do you need to maintain the original order? Is the result supposed to be sorted?

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.