Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Not understanding while loop counting

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


in reply to Re: Not understanding while loop counting
in thread Not understanding while loop counting

Addendum: see also perlsyn#For-Loops

Perl's C-style for loop works like the corresponding while loop; that means that this:
for ($i = 1; $i < 10; $i++) { ... }
is the same as this:
$i = 1; while ($i < 10) { ... } continue { $i++; }

NB I have to admit I practically never use continue ...

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 20:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found