in reply to Re: until Loop Question
in thread until Loop Question

Clearly I am confused on the usage of the until loop. And while I have reworked the code to avoid the until loop entirely I would be interested to see how someone would correctly write:

until something changes do this else do that

or am I now hoplessly confused?
--
lmoran@wtsg.com
There's more than one way to do it, just don't use my way.

Replies are listed 'Best First'.
Re: Re: Re: until Loop Question
by lestrrat (Deacon) on Dec 14, 2001 at 06:06 UTC
    do{ ## do something that may or may not change $condition } until( $condition )

    ... this will execute the block after "do" until the expression after "until" evaluates to true. more examples....

    ## print "foo" until $count becomes 5 my $count = 0; do{ print "foo\n"; $count++; } until ( $count == 5 ); ## call some command until its exit status ## is 0 ( success ) do { system( "cmd" ); } until( $? == 0 );