Why not use slices to obtain and copy a complete subset of parent 1 in one operation and then parent2 in a second operation?
@newArray = ( @parent1[0..$crossover], @parent2[$crossover+1..$#parent2] );
Darn, my brain has gone blank. There must be a better way to specify the slice continues until the end of the array: $parent2[-1] is the last element, but @parent[3..-1] is empty even if @parent2 has more than four elements.
--
TTTATCGGTCGTTATATAGATGTTTGCA
In reply to Re: Optimization of array looping...
by TomDLux
in thread Optimization of array looping...
by salonmonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |