XP is just a number | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Generally I'm trying to avoid to call iterators in scalar context, because of edge cases where a useful return value is false and stops the while loop.
I prefer clear stop values... For instance
is terminated for
but
is only terminated in the first case. You still have the liberty to return undef or [] as valid values. In your special snippet undef or [] don't make much sense, but this approach helps avoiding quirks like 0 but true ! Anyway I wonder why the iterator was designed to return an array reference... Why not right away returning a list?
Cheers Rolf ( addicted to the Perl Programming Language) In reply to Re: Unconventional exit from while loop
by LanX
|
|