| Net-Z3950 documentation | view source | Contained in the Net-Z3950 distribution. |
Net::Z3950::ScanSet - set of terms received in response to a Z39.50 scan
$ss = $conn->scan('@attr 1=4 fish');
die $conn->errmsg() if !defined $ss;
$size = $ss->size();
for ($i = 0; $i < $size; $i++) {
$term = $ss->term($i);
$count = $ss->field($i, "freq");
$displayTerm = $ss->field($i, "display");
print "$displayTerm ($count) [$term]\n";
}
A ScanSet object represents the set of terms found by a Z39.50 scan.
There is no public constructor for this class. ScanSet objects are
always created by the Net::Z3950 module itself, and are returned to
the caller via the Net::Z3950::Connection class's scan() or
scanResult() method.
if (!defined $ss->term($i)) {
print "error ", $ss->errcode(), " (", $ss->errmsg(), ")\n";
print "additional info: ", $ss->addinfo(), "\n";
}
When the term() or <field()> method returns an undefined value,
indicating an error, it also sets into the scan-set the BIB-1 error
code and additional information returned by the server. They can be
retrieved via the errcode() and addinfo() methods.
As a convenience, $ss-errmsg()> is equivalent to
Net::Z3950::errstr($ss-errcode())>.
Mike Taylor <mike@indexdata.com>
First version Friday 7th May 2004.
| Net-Z3950 documentation | view source | Contained in the Net-Z3950 distribution. |