Array-Iterator
view release on metacpan or search on metacpan
lib/Array/Iterator/Circular.pm view on Meta::CPAN
This method will tell you how many times the iterator has looped back to its start.
=back
=cut
sub _init {
my ($self, $length, @args) = @_;
$self->{loop_counter} = 0;
$self->SUPER::_init($length, @args);
}
# always return true, since
# we just keep looping
sub has_next { 1 }
sub next {
my $self = $_[0];
unless ($self->_current_index < $self->getLength()) {
( run in 1.968 second using v1.01-cache-2.11-cpan-39bf76dae61 )