in reply to Not understanding while loop counting

for the same reason why 0 is never printed.

you print after incrementing but before the next loop iteration is tested.

just move the print to the top to see the difference.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re: Not understanding while loop counting