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.

Replies are listed 'Best First'.
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:~$