- $conn1 = new ZOOM::Connection("bagel.indexdata.com/gils");
- $conn2 = new ZOOM::Connection("z3950.loc.gov:7090/Voyager");
- $pod = new ZOOM::Pod($conn1, $conn2);
- $pod->callback(ZOOM::Event::RECV_SEARCH, \&show_result);
- $pod->search_pqf("mineral");
- $pod->wait();
+ use ZOOM::Pod;
+
+ $pod = new ZOOM::Pod("bagel.indexdata.com/gils",
+ "bagel.indexdata.com/marc");
+ $pod->callback(ZOOM::Event::RECV_SEARCH, \&completed_search);
+ $pod->callback(ZOOM::Event::RECV_RECORD, \&got_record);
+ $pod->search_pqf("the");
+ $err = $pod->wait();
+ die "$pod->wait() failed with error $err" if $err;
+
+ sub completed_search {
+ ($conn, $rs) = @_;
+ print $conn->option("host"), ": found ", $rs->size(), " records\n";
+ $rs->record(0); # Queues a request for the record
+ return 0;
+ }