My understanding is that the while will execute so long as there are elements in @a...
ivanthemad: I expect you already understand the following point perfectly well, but I want to dispell my sneaking suspicion of a possible misapprehension on your part.
The while-loop in the example code will only begin execution (Update: of a loopthe loop body) if the array is non-empty. However, (Update: once begun) looploop body execution will continue regardless of the state of the array unless an explicit loop exit is made conditional upon array state, e.g., with a statement like last unless @a;.
Update: Clarified (hopefully) pertinence to loop body per repellent.
In reply to Re: arrays: shifting in while loop
by AnomalousMonk
in thread arrays: shifting in while loop
by ivanthemad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |