...
/Looping Directives: while and until
Looping Directives: while and until
Learn about the while and until looping directives.
We'll cover the following...
We'll cover the following...
The while directive
A while loop continues until the loop conditional expression evaluates to a false value. Here’s an idiomatic infinite loop:
Unlike the iteration foreach-style loop, the while loop’s condition has no side
effects. If @values has one or more elements, this code is also an infinite loop, because every iteration will evaluate @values in scalar context to a non-zero
value and iteration will continue:
To prevent such an infinite while loop, use a destructive update of the @values array by modifying the array ...