=encoding euc-jp =head1 名前 Class::DBI::Iterator - Class::DBIの検索結果イテレータ =head1 概要 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); $it->delete_all; =head1 説明 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. 複数オブジェクトを返すClass::DBIのどんな検索(has_manyメソッドを含む)も、 単純にスカラーコンテキストで検索を実行することによって、オブジェクトの 代わりにイテレータを返すようにつくることができる。 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. こうすると一度に結果を全て取り出すのではなく、一回ごとに一つを取り出せる ようになる。これは潜在的に相当量のプロセスタイムとメモリの節約になるだろう。 =head1 注意 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. 検索の実行と次の結果を取り出す間におけるデータベース内の データ変更(あるいは削除さえも)は用意していないことに注意。