in reply to Unconventional exit from while loop
Something like this is fairly commonly seen:
while( my ( $z, $y, $x, $w ) = @{ $iter->next // [] } ) { ...; }
When next returns undef, you end up assigning an empty array to ( $z, $y, $x, $w ). List assignment evaluates to the size of the array on the right hand side, which is zero, thus false, and exits the loop.
In place of // you could use || or or.
|
|---|