Template::Flute::Iterator - Generic iterator class for Template::Flute
$cart = [{isbn => '978-0-2016-1622-4', title => 'The Pragmatic Programmer', quantity => 1}, {isbn => '978-1-4302-1833-3', title => 'Pro Git', quantity => 1}, ]; $iter = new Template::Flute::Iterator($cart); print "Count: ", $iter->count(), "\n"; while ($record = $iter->next()) { print "Title: ", $record->title(), "\n"; } $iter->reset(); $iter->seed({isbn => '978-0-9779201-5-0', title => 'Modern Perl', quantity => 10});
Creates a Template::Flute::Iterator object. The elements of the iterator are hash references. They can be passed to the constructor as array or array reference.
Returns next record or undef.
Returns number of elements.
Resets iterator.
Seeds iterator.
Stefan Hornburg (Racke), <racke@linuxia.de>
Copyright 2010-2011 Stefan Hornburg (Racke) <racke@linuxia.de>.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
Template::Flute::Iterator::JSON
To install Template::Flute, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Flute
CPAN shell
perl -MCPAN -e shell install Template::Flute
For more information on module installation, please visit the detailed CPAN module installation guide.