The point was that while( my $next = $iter->() ) { ($next) = @$next; ... } is a complicated version of while( my $next = @{ $iter->() } ) { ... }
Not so. In the latter case when the iterator returns undef to terminate iteration, you will attempt to dereference that undef causing an error.
In the former, the loop terminates and the dereference is never reached.
In reply to Re^7: Dumb, non-question: How to return 'nothing'.
by BrowserUk
in thread Dumb, non-question: How to return 'nothing'.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |