Iterator::Flex - Iterators with flexible behaviors
version 0.12
Note! Iterator::Flex is alpha quality software.
Iterator::Flex
Iterator::Flex provides iterators that can:
rewind to the beginning, keeping track of state (e.g. cycles which always know the previous value).
reset to the initial state
serialize, so that you can restart from where you left off,
signal exhaustion by returning a sentinel value (e.g. undef) or throwing an exception, and provide a test for exhaustion via the is_exhausted method.
undef
is_exhausted
wrap existing iterators so that they have the same exhaustion interface as your own iterators
provide history via prev and current methods.
prev
current
These are optional things behaviors that an iterator can support. Not all iterators need the bells and whistles, but sometimes they are very handy.
See Iterator::Flex::Common for a set of common iterators. These are pre-made for you. See Iterator::Flex::Manual::Using for how to use them.
See Iterator::Flex::Manual::Authoring for how to write your own flexible iterators.
See Iterator::Flex::Manual::Internals for how everything links together.
Iterator::Flex::Manual
Iterator::Flex::Manual::Caveats
Please report any bugs or feature requests to bug-iterator-flex@rt.cpan.org or through the web interface at: https://rt.cpan.org/Public/Dist/Display.html?Name=Iterator-Flex
Source is available at
https://gitlab.com/djerius/iterator-flex
and may be cloned from
https://gitlab.com/djerius/iterator-flex.git
Diab Jerius <djerius@cpan.org>
This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007
To install Iterator::Flex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Iterator::Flex
CPAN shell
perl -MCPAN -e shell install Iterator::Flex
For more information on module installation, please visit the detailed CPAN module installation guide.