my $people = ...; # First generation. my $generations = ...; for (2 .. $generations) { $people += int rand 6 for 1 .. $people; }