Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: do/redo or for(;;): what's Kosher?

by runrig (Abbot)
on Jan 03, 2002 at 23:03 UTC ( #136048=note: print w/ replies, xml ) Need Help??


in reply to Re: do/redo or for(;;): what's Kosher?
in thread do/redo or for(;;): what's Kosher?

...it's not obvious to me that it's an infinite loop...

Its easy to see on a short, simple loop, but on longer more complex things I just label loops as such (or whatever they function as):

# I usually include the label in the loop control statement # so everything's immediately obvious, but I omit them here. LOOP: { last if $something; ... redo; } INFINITELOOP: { ... redo; } FILTER_FOO_LOOP: { next if foo(); ... redo; } FOO_SWITCH: { foo() and last; foobar() and last if something(); }


Comment on Re: Re: do/redo or for(;;): what's Kosher?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2015-07-30 01:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls