in reply to Combining arrays with grep/unless?

didn't see this type of solution in this thread yet, so here goes:
my @group1 = ('A','B','C','D','E'); my @group2 = ('F','G','H','I','J'); my @group1 = sort keys %{{map {$_ => 1} @group1, @group2}};
Note that the sort is optional, but otherwise the order will be random.