Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by Anonymous Monk
on Jan 04, 2002 at 12:35 UTC ( #136233=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?

Personally, I just omit the condition all together:

while() { ... }
Not sure why it works, but it does.


Comment on Re: Re: do/redo or for(;;): what's Kosher?
Download Code
Re: Re: Re: do/redo or for(;;): what's Kosher?
by Juerd (Abbot) on Jan 04, 2002 at 13:47 UTC
    This is why it works:
    2;0 juerd@ouranos:~$ perl -MO=Deparse -e'while () { print "1\n" }' for (;;) { print "1\n"; } -e syntax OK


    Many people aren't going to like this:
    2;0 juerd@ouranos:~$ perl -MO=Deparse -e'while (1) { print "1\n" }' for (;;) { print "1\n"; } -e syntax OK


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2015-07-03 17:42 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 (54 votes), past polls