$ /usr/bin/perl -MList::MoreUtils=distinct -le '@new = (1..4); my @old = (4..8);; print join(", ", distinct(@new, @old));' 1, 2, 3, 4, 5, 6, 7, 8