Acme-JMOLLY-Utils
view release on metacpan or search on metacpan
lib/Tie/Cycle.pm view on Meta::CPAN
my $index = $self->[CURSOR_COL]++;
$self->[CURSOR_COL] %= $self->_count;
return $self->_item( $index );
}
sub STORE {
my( $self, $list_ref ) = @_;
return unless ref $list_ref eq ref [];
my @shallow_copy = map { $_ } @$list_ref;
$self->[CURSOR_COL] = 0;
$self->[COUNT_COL] = scalar @shallow_copy;
$self->[ITEM_COL] = \@shallow_copy;
}
sub reset { $_[0]->[CURSOR_COL] = 0 }
sub previous {
my( $self ) = @_;
( run in 1.398 second using v1.01-cache-2.11-cpan-49f99fa48dc )