debian man page for class::dbi::iterator

Query: class::dbi::iterator

OS: debian

Section: 3pm

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

Class::DBI::Iterator(3pm)				User Contributed Perl Documentation				 Class::DBI::Iterator(3pm)

NAME
Class::DBI::Iterator - Iterate over Class::DBI search results
SYNOPSIS
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.
CAVEAT
Note that there is no provision for the data changing (or even being deleted) in the database inbetween performing the search and retrieving the next result. perl v5.12.4 2005-09-11 Class::DBI::Iterator(3pm)
Related Man Pages
dbix::class::storage::dbi::cursor(3) - mojave
class::dbi::search::basic(3pm) - debian
class::dbi::relationship(3pm) - debian
class::dbi::sweet::topping(3pm) - debian
class::dbi::test::sqlite(3pm) - debian
Similar Topics in the Unix Linux Community
How can I do this in VI editor?
Detecting unused variables...
One instance of comparing grep and awk
Weird 'find' results
New UNIX and Linux History Sections