Rose::...erator(3pm)
π NAME π
okay so this is the Rose::DB::Object::Iterator(3pm) page, and the manual name is User Contributed Perl Documentation β iconic. It's all about Rose::DB::Object::Iterator: an iterator over a series of Rose::DB::Objects. periodt π
β¨ SYNOPSIS β¨
bestie, here's the exact group-chat demo:
$iterator = Rose::DB::Object::Manager->get_objects_iterator(...);
while($object = $iterator->next)
{
# do stuff with $object...
if(...) # bail out early
{
$iterator->finish;
last;
}
}
if($iterator->error)
{
print "There was an error: ", $iterator->error;
}
else
{
print "Total: ", $iterator->total;
}
The way this works: you get an iterator, keep calling next, bail early with finish if you need to, then check error before printing total. iykyk πβ¨
πΈ DESCRIPTION πΈ
Rose::DB::Object::Iterator is an iterator object that traverses a database query, returning Rose::DB::Object-derived objects for each row. No cap. Rose::DB::Object::Iterator objects are created by calls to the get_objects_iterator method of Rose::DB::Object::Manager or one of its subclasses. π¦
π OBJECT METHODS π
π
error
Returns the text message associated with the last error, or false if there was no error. So if something goes sideways, this is the receipt. π§Ύ
π finish
Prematurely stop the iteration (i.e., before iterating over all of the available objects). This is the bail-early button in the synopsis vibe. π
β‘οΈ next
Return the next Rose::DB::Object-derived object. Returns false (but defined) if there are no more objects to iterate over, or undef if there was an error. This false-but-defined distinction is important, bestie. π«Ά
π’ total
Returns the total number of objects iterated over so far. π
π AUTHOR π
John C. Siracusa (siracusa@gmail.com) β author icon. π
π LICENSE π
Copyright (c) 2010 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Slay, legal text. π
And the cute footer sign-off: this page is Rose::...erator(3pm) from perl v5.40.1, dated 2025-08-21 β mwah πβ¨
π¦ where this page comes from
- ubuntu resolute: librose-db-object-perl 1:0.822-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: librose-db-object-perl 1:0.822-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms