push @new, shift(@array1) . pop @array2 while @array1;