for my $t (1..$maxtime){ Innen: for my $i (0..$#population){ $age[$i]++; if ($age[$i]>=10){ splice (@age, $i, 1); splice (@weight, $i, 1); splice (@gender, $i, 1); splice (@population, $i, 1); # $age[$i]++; next Innen; } } for my $i (0..$#population){ printf "$age[$i] $gender[$i] $weight[$i]\n"; } my $population=$#population+1; printf "\npopulation: $population\n"; }