I think I've settled on requiring that the iterator be called in a list context. Eg.:
sub i{ my $n = shift; return sub{ $n ? $n-- : () } };; $i = i( 5 ); print $_ while ( $_ ) = $i->();; 5 4 3 2 1
In reply to Re^3: Dumb, non-question: How to return 'nothing'.
by BrowserUk
in thread Dumb, non-question: How to return 'nothing'.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |