I have this simple scripts that looks up ISSN and returns the subject. Why it is returning two records for the same ISSN? use strict; use Net::Z3950;
use MARC::Record;
use MARC::File::USMARC;
use MARC::Field;


my $conn = new Net::Z3950::Connection('z3950.loc.gov', 7090,databaseName => 
'Voyager');
my $issn="0896-9205";
my $query = '@attr 1=8 ' . $issn;
$conn->option(preferredRecordSyntax => "USMARC", elementSetName => 'b');
my $rs = $conn->search($query)
       or die $conn->errmsg();
my $n = $rs->size();
print "found $n records\n";
for (my $i = 1; $i <= $n; $i++) {
 my $rec = $rs->record($i)
       or die $rs->errmsg();
my $m = MARC::Record->new_from_usmarc($rec->rawdata());
print $m->subfield('650',"a"), "\n";
#print $rec->render();
}

# perl test.pl
found 2 records
Sociology
Sociology

--
Sharif Islam                 Research Programmer
Library Systems Office       University of Illinois Urbana-Champaign
http://www.library.uiuc.edu  phone:  (217) 244-4688

Reply via email to