my @new = (1,2,3,4); my @old = (4,5,6,7,8); push @new, (array_minus( @old, @new))[0..2]; # Einzeiler print join ",", @new;