perl -Mstrict -MArray::Utils=:all -WE 'my @x=(1,1,2,3,4,3); my @y=(0,3,4,5,6,3,7,8); say for unique intersect @x, @y' #### 3 4