in reply to Re: RFC: Regexp::AllMatches
in thread RFC: Regexp::AllMatches
I'll definately consider ::Exhaustive. Thanks!
does ->next() return a list? if yes, why?
There are different opinions and tastes regarding this. I prefer to design iterators so that the next method returns undef in scalar context and the empty list in list context when it's exhausted. A successful match may be "" or "0", and that would force me to write
to not leave the loop prematurely.while (defined(my $match = $matcher->next)) { ... }
lodin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: RFC: Regexp::AllMatches
by wind (Priest) on Aug 07, 2007 at 00:25 UTC |