Good day. As with Perl, you can insert elements of one array into another after a certain number of elements.
There is an array
@DATA=[1a,2b,3c,4d,5f,6g,7q,8r,...235bgh,1b,2g,3k,4j...]; That is, I do not know what exactly is contained in rows, in an array of more than 1000k rows. I need to add array elements to this array in turn:
@DATA2=[xxx,yyy,zzz,...]; In which the content of the strings is also not known, after every 235 line of the @DATA array
Using splice adds all the elements immediately after you need a line (basically, as it should be)
open (IN,"<$xxx"); open (OUT, "<$zzz"); my @DATA=<OUT>; my @DATA2=<IN>; splice @DATA, 234,0,@DATA2; print dump(\@DATA); close IN; close OUT; Can there be other ways to do this?