RT::Cl...Result(3pm)

πŸ’– RT::Client::REST::SearchResult(3pm) πŸ’–

okay bestie, welcome to the manual page for RT::Client::REST::SearchResult β€” it's part of the User Contributed Perl Documentation, and it's literally just the little search-results object. picture me handing you a sparkly gift bag and going "here, this is what you get back when you search." πŸŽ€


✨ VERSION ✨

version 0.73 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

  my $iterator = $search->get_iterator;
  my $count = $iterator->count;

  while (defined(my $obj = &$iterator)) {
    # do something with the $obj
  }

πŸ’… DESCRIPTION πŸ’…

so this class is, like, the representation of a search result. it's the type of object you get handed back when you call the method search() on objects derived from RT::Client::REST::Object. it makes iterating over your results easy, and it also lets you find out exactly how many of them there are. lowkey so handy. ✨


πŸ‘‘ METHODS πŸ‘‘

count πŸ’―

returns the number of search results. this number is always gonna stay the same unless you go stick your grubby little fingers into the object and abuse it πŸ™ˆ β€” like, don't do that. also important: this number is not affected by calls to get_iterator().

get_iterator πŸ”

returns a reference to a subroutine, and that sub is what you use to iterate over the results.

evaluating it in scalar context returns the next object, or "undef" if all the results have already been iterated over. quick heads up: for each object to be instantiated with the correct values, the retrieve() method gets called on the object before it's returned to you. no cap.

evaluating the subroutine reference in list context returns a list of all the results, fully instantiated.

⚠️ WARNING: this could get expensive, because every single object gets hit with the retrieve() method. and bestie, heads up β€” subsequent calls to the iterator result in an empty list. 😭

you may safely mix calling the iterator in scalar and list context. for example:

  $iterator = $search->get_iterator;

  $first = &$iterator;
  $second = &$iterator;
  @the_rest = &$iterator;

and the best part? you can get as many iterators as you want β€” they will not step on each other's toes. 🫢 iconique.

new 🌱

you should not have to call it yourself, but for the sake of completeness, here are the arguments:

  my $search = RT::Client::REST::SearchResult->new(
    ids => [1 .. 10],
    object => sub {       # Yup, that's a closure.
      RT::Client::REST::Ticket->new(
        id => shift,
        rt => $rt,
      );
    },
  );

🌈 SEE ALSO 🌈

RT::Client::REST::Object, RT::Client::REST.


🫢 AUTHOR 🫢

Dean Hamstead <dean@fragfest.com.au>


this software is copyright (c) 2026, 2020 by Dmitri Tikhonov.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, honestly. ✨


and that's the whole page, bestie!! πŸ’– brought to you by perl v5.40.1, dated 2026-04-21 β€” mwah, go forth and iterate responsibly πŸŽ€πŸ’…πŸŒΈ

πŸ“¦ where this page comes from