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.
Net::Z3950::Connection
scan()
scanResult()
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.
term()
errcode()
addinfo()
As a convenience, $ss-errmsg()> is equivalent to Net::Z3950::errstr($ss-errcode())>.
$ss-
Net::Z3950::errstr($ss-
Mike Taylor <mike@indexdata.com>
First version Friday 7th May 2004.
To install Net::Z3950, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Z3950
CPAN shell
perl -MCPAN -e shell install Net::Z3950
For more information on module installation, please visit the detailed CPAN module installation guide.