Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: do while loops

by sapnac (Beadle)
on Dec 01, 2006 at 15:18 UTC ( #587209=note: print w/ replies, xml ) Need Help??


in reply to do while loops

What do you do if you want to exit out of the loop earlier? This should be covered under this topic as it differs from one to another. Last; -> to break out next; -> to skip to next


Comment on Re: do while loops
Re^2: do while loops
by f00li5h (Chaplain) on Dec 02, 2006 at 11:41 UTC

    do{ ... } while $foo; isn't a loop, it's a block with a postfixed while, so you need to label it to re-do it.

    @_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;
      sum = 0; for (x = 1; x <= 5; x++) { printf("%d", x); sum = sum + x; printf("The sum is %d", sum); }

        for(;;) loops are ick... they tend to lead to unneeded subscripting and other pesky things

        for my $x (1..4) is far less intent-obfuscated-by-code looking (as far as i see it anyway)

        wait, is that C?

        @_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2014-07-29 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls