my @generations = ( $generation ); for(2 .. $generations ) { push @generations, $generations[-1]*2.5; shift @generations if $#generations >= 3; }