my @new = do{ my %seen; grep !$seen{$_}++, @a, @b, @c, @d; };