NAME
Iterator::Flex::Flatten - Flatten Iterator Class
VERSION
version 0.32
METHODS
new
$iterator = Ierator::Flex::Flatten->new( $iterable, ?\%pars );
For each value that $iterable
yields, iterate over it if its an iterable, otherwise return it.
For example, if
$iterable = [ iseq(1,3), 4, [ 5,6,7 ], [ [8,9,10] ] ]
$iterator
yields
1, 2, 3, 4, 5, 6, 7, [ 8, 9, 10 ]
$iterable
is converted into an iterator via "to_iterator" in Iterator::Flex::Factory if required.
The optional %pars
hash may contain standard signal parameters.
The iterator supports the following capabilities:
- next
- current
- prev
- reset
- rewind
-
reset and rewind are fully supported if all of the elements generated by
$iterable
support them (arrays do). As it is not known if an element supports these until it is retrieved from$iterable
, a rewind or reset operation will not immediately throw an exception. Instead, it will be thrown when$iteratable
is advanced to an element which does not support them.
SUPPORT
Bugs
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
Source is available at
https://gitlab.com/djerius/iterator-flex
and may be cloned from
https://gitlab.com/djerius/iterator-flex.git
SEE ALSO
Please see those modules/websites for more information related to this module.
AUTHOR
Diab Jerius <djerius@cpan.org>
COPYRIGHT AND LICENSE
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