Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rt::client::rest::searchresult(3pm) [debian man page]

RT::Client::REST::SearchResult(3pm)			User Contributed Perl Documentation		       RT::Client::REST::SearchResult(3pm)

NAME
RT::Client::REST::SearchResult -- Search results representation. SYNOPSIS
my $iterator = $search->get_iterator; my $count = $iterator->count; while (defined(my $obj = &$iterator)) { # do something with the $obj } DESCRIPTION
This class is a representation of a search result. This is the type of the object you get back when you call method "search()" on RT::Client::REST::Object-derived objects. It makes it easy to iterate over results and find out just how many there are. METHODS
count Returns the number of search results. This number will always be the same unless you stick your fat dirty fingers into the object and abuse it. This number is not affected by calls to "get_iterator()". get_iterator Returns a reference to a subroutine which is used 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. Note that for each object to be instantiated with correct values, retrieve() method is called on the object before returning it to the caller. Evaluating the subroutine reference in list context returns a list of all results fully instantiated. WARNING: this may be expensive, as each object is issued retrieve() method. Subsequent calls to the iterator result in 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; You can get as many iterators as you want -- they will not step on each other's toes. new You should not have to call it yourself, but just 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
Dmitri Tikhonov <dtikhonov@yahoo.com> perl v5.14.2 2011-12-27 RT::Client::REST::SearchResult(3pm)

Check Out this Related Man Page

XML::Atom::Client(3pm)					User Contributed Perl Documentation				    XML::Atom::Client(3pm)

NAME
XML::Atom::Client - A client for the Atom API SYNOPSIS
use XML::Atom::Client; use XML::Atom::Entry; my $api = XML::Atom::Client->new; $api->username('Melody'); $api->password('Nelson'); my $entry = XML::Atom::Entry->new; $entry->title('New Post'); $entry->content('Content of my post.'); my $EditURI = $api->createEntry($PostURI, $entry); my $feed = $api->getFeed($FeedURI); my @entries = $feed->entries; my $entry = $api->getEntry($EditURI); DESCRIPTION
XML::Atom::Client implements a client for the Atom API described at http://bitworking.org/projects/atom/draft-gregorio-09.html, with the authentication scheme described at http://www.intertwingly.net/wiki/pie/DifferentlyAbledClients. NOTE: the API, and particularly the authentication scheme, are still in flux. USAGE
XML::Atom::Client->new(%param) $api->use_soap([ 0 | 1 ]) XML::Atom::Client supports both the REST and SOAP-wrapper versions of the Atom API. By default, the REST version of the API will be used, but you can turn on the SOAP wrapper--for example, if you need to connect to a server that supports only the SOAP wrapper--by calling use_soap with a value of 1: $api->use_soap(1); If called without arguments, returns the current value of the flag. $api->username([ $username ]) If called with an argument, sets the username for login to $username. Returns the current username that will be used when logging in to the Atom server. $api->password([ $password ]) If called with an argument, sets the password for login to $password. Returns the current password that will be used when logging in to the Atom server. $api->createEntry($PostURI, $entry) Creates a new entry. $entry must be an XML::Atom::Entry object. $api->getEntry($EditURI) Retrieves the entry with the given URL $EditURI. Returns an XML::Atom::Entry object. $api->updateEntry($EditURI, $entry) Updates the entry at URL $EditURI with the entry $entry, which must be an XML::Atom::Entry object. Returns true on success, false otherwise. $api->deleteEntry($EditURI) Deletes the entry at URL $EditURI. $api->getFeed($FeedURI) Retrieves the feed at $FeedURI. Returns an XML::Atom::Feed object representing the feed returned from the server. ERROR HANDLING Methods return "undef" on error, and the error message can be retrieved using the errstr method. AUTHOR &; COPYRIGHT Please see the XML::Atom manpage for author, copyright, and license information. perl v5.12.4 2011-09-27 XML::Atom::Client(3pm)
Man Page