Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Not understanding while loop counting

by LanX (Saint)
on Aug 10, 2020 at 08:15 UTC ( [id://11120538]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11120538]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-23 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found