Class::DBI::Iterator (3)
Leading comments
Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) Standard preamble: ========================================================================
NAME
Class::DBI::Iterator - Iterate over Class::DBI search resultsSYNOPSIS
my $it = My::Class->search(foo => 'bar'); my $results = $it->count; my $first_result = $it->first; while ($it->next) { ... } my @slice = $it->slice(10,19); my $slice = $it->slice(10,19); $it->reset; $it->delete_all;
DESCRIPTION
Any Class::DBI search (including a has_many method) which returns multiple objects can be made to return an iterator instead simply by executing the search in scalar context.Then, rather than having to fetch all the results at the same time, you can fetch them one at a time, potentially saving a considerable amount of processing time and memory.