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

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

by Juerd (Abbot)
on Jan 05, 2002 at 00:08 UTC ( #136366=note: print w/ replies, xml ) Need Help??


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

That won't be optimized away, but a constant true value (not 0, "0", "" or undef) are.
This means you can have less code and more efficiency, but still the clarity you like:

while ('forever'){ ... }


Which is equivalent to while (1) { ... }, which is optimized to for (;;) { ... }.

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$


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

Log In?
Username:
Password:

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

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

    When choosing user names for websites, I prefer to use:








    Results (252 votes), past polls