splice() offset past end of array at foo.pl line 146.
splice() offset past end of array at foo.pl line 147.
splice() offset past end of array at foo.pl line 158.
####
sub makeArrays
{
$lower = 10;
$upper = 20;
my @chroma;
my @chromb;
my $ranpop;
$ranpop = int rand($upper - $lower + 1) + $lower;
# @arrA and @arrD hold the same values, and
# aren't modified - why do you need them both?
# what is their purpose?
my @arrA = ( 1 .. $ranpop );
my @arrD = (1 .. $ranpop );
my $limiter = 50;
# you can write that shorter:
# my @holda = map { int rand($limiter)} 1 .. $randpop;
# my @holdb = map { int rand($limiter)} 1 .. $randpop;
my @holda;
my @holdb;
while ($ranpop)
{
my $genea = int rand ($limiter);
push(@holda, $genea);
my $geneb = int rand ($limiter);
push(@holdb, $geneb);
$ranpop--;
}
# there's no need to copy these arrays
# you can return \@holda and \@holdb directly.
my @arrB = ( @holda );
my @arrC = ( @holdb );
return \@arrA, \@arrB, \@arrC, \@arrD;
}
####
my $childa = $dada;
my $childb = $momb;
push @chroma, $childa;
push @chromb, $childb;
####
push @chroma, $dada;
push @chromb, $momb;