For a general-purpose File::Collector, I would expect support for multiple iterators even over the same category. ...
And it just dawned on me: since Iterators are now circular (and presumably the empty string is not a valid file name, although it could be replaced with undef if someone tries this on a platform where it is valid and complains), all you need to support independent iterators for applications that want them is a ->clone method on iterators:
sub clone { my $self = shift; bless [@$self], ref $self; }
And you have made a change that is going to bite your users with infinite loops: the AUTOLOAD for ::Iterator::All should advance the iterator itself: $$self->$method(@_) while ($$self->next); or $$self->method(@) while (defined $$self->next); if you choose to make the end-of-set marker undef instead of an empty string. The method called by invoking ->do should not advance the iterator itself, but only use $self->selected_file.
In reply to Re^21: How to completely destroy class attributes with Test::Most?
by jcb
in thread How to completely destroy class attributes with Test::Most?
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |