in reply to Re: Unconventional exit from while loop
in thread Unconventional exit from while loop

I checked Algorithm::Combinatorics documentation and source, undef is exit-code and all other return values are array-refs.

Note [] is listed as valid edge case but would make your loop exit.

So the version from the synopsis (which is also BUK's) is the generic one for this module and works always...

while (my $x = $iter->next() ){ ... }

...cause array-refs are always true.

Cheers Rolf

( addicted to the Perl Programming Language)