Author image Andy Lester

NAME

List::Cycle - Objects for cycling through a list of values

VERSION

Version 0.02

SYNOPSIS

    use List::Cycle;

    my $color = List::Cycle->new( {vals => ['#000000', '#FAFAFA', '#BADDAD']} );
    print $color->next; # #000000
    print $color->next; # #FAFAFA
    print $color->next; # #BADDAD
    print $color->next; # #000000

FUNCTIONS

new( {vals => \@values} )

Creates a new cycle object, using @values.

$cycle->reset

Sets the internal pointer back to the beginning of the cycle.

$cycle->dump

Returns a handy string representation of internals.

$cycle->next

Gives the next value in the sequence.

AUTHOR

Andy Lester, <andy@petdance.com>

BUGS

Please report any bugs or feature requests to bug-list-cycle @ rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=List-Cycle. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

ACKNOWLEDGEMENTS

List::Cycle is a playground that uses some of the ideas in Damian Conway's marvelous Perl Best Practices, due out in mid-2005 from O'Reilly. One of the chapters mentions a mythical List::Cycle module, so I made it real.

COPYRIGHT & LICENSE

Copyright 2005 Andy Lester, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.