sub gene_length { my @gls = sort map { length } keys %genome; die "Invalid genotype" unless $gls[0] == $gls[$#gls]; return $gls[0]; } #### use List::Util 'first'; sub check_for_winner { return first { get_result($_) == $target } @population } #### use List::Util 'sum'; sub get_population_fitness_score { return sum map { get_fitness_score($_) } @population; }
## use List::Util 'first'; sub check_for_winner { return first { get_result($_) == $target } @population } ##
## use List::Util 'sum'; sub get_population_fitness_score { return sum map { get_fitness_score($_) } @population; }