On Wed, Aug 16, 2006 at 08:21:29PM -0400, Joe Gottman wrote:
: Is a NEXT clause called before or after the update portion of a general loop
: statement?  For instance, consider the following code:
: 
:  
: 
: loop $n = 0; $n < 5; ++$n {
: 
:     NEXT {print $n;}
: 
: }
: 
:  
: 
: Is the output 01234 or 12345?

I'd say 01234 on the theory that the 3-arg loop is really saying:

    $n = 0;
    while $n < 5 {
        NEXT { ++$n }
        NEXT { print $n }
    }

and also on the theory that block exiting blocks always run in reverse order.

Larry

Reply via email to