my @parents = @population[40 .. 49]; shuffle @parents; my @children; push @children, crossover( pop @parents, pop @parents ) while @parents; @population[0 .. 4] = map { mutate($_) } @children;