GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CLASS::DBI::ITERATOR (3)

.ds Aq ’

NAME

Class::DBI::Iterator - Iterate over Class::DBI search results

CONTENTS

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.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CLASS::DBI::ITERATOR (3) 2005-09-11

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.