use Array::Utils qw(:all); my @new = (1,2,3,4); my @old = (4,5,6,7,8); push @new, splice(@{[array_minus( @old, @new)]}, 0, 3); # Einzeiler print join ",", @new;