Hi, I apologise for having sent that to Dr. Rathbun in private - that was not my intention but a misuse of software. Resending to the list.
On Sun, 16 Sep 2012 19:31:01 -0700 (PDT) jmrhide-p...@yahoo.com wrote: > for (my $loopiter = 0; $loopiter < $loopmax; $loopiter++) { #1 > if ($loopiter >= ($loopmax - 1)) { die "Loop number > $loopnum has iterated $loopiter times" } This line (#2) will throw an exception in the final iteration of the loop, so it's not ogood. > $termnum[0] = int( rand($defnum) ); > last unless ( $termnum[0] == $lastnum ); Why are you assigning and checking $termnum[0] (the 0th element of the array @termnum)? This seems wrong. > } > $loopnum++; > > This may be ugly, but the first line adapts something in perlsyn: > > for (my $i = 0; $i < @ary1; $i++) {Leaving aside other concerns, for > the moment, is there a better way to write that first line? > You can use: for my $loopiter (0 .. $loopmax-1) { } Regards, Shlomi Fish > John M Rathbun MD -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ Rethinking CPAN - http://shlom.in/rethinking-cpan Chuck Norris was never a newbie! He will kill anyone who implies otherwise. In a very not newbie-like manner. Please reply to list if it's a mailing list post - http://shlom.in/reply . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/