perl -MList::MoreUtils=uniq -e ' @arr1=(1,2,1); @arr2=(2,3,3); my @foo = map {$_ } uniq @arr1, @arr2; print @foo ' 123