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