X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=samples%2Fnet-z3950%2Fzoomtst1.pl;h=ca96b2939caf55048cd05bac9a2af0cf22e19998;hb=e041c9a04e42772e25ca7d2b275380ade3f64971;hp=0c793a39776b1307296cd61e5744898ee50d414e;hpb=22ba4cea82444cfaab55ba4b787d909d9ac2d307;p=ZOOM-Perl-moved-to-github.git diff --git a/samples/net-z3950/zoomtst1.pl b/samples/net-z3950/zoomtst1.pl index 0c793a3..ca96b29 100644 --- a/samples/net-z3950/zoomtst1.pl +++ b/samples/net-z3950/zoomtst1.pl @@ -1,5 +1,3 @@ -# $Id: zoomtst1.pl,v 1.2 2005-10-12 14:35:46 mike Exp $ -# # See ../README for a description of this program. # perl -I../../blib/lib -I../../blib/arch zoomtst1.pl @@ -9,22 +7,22 @@ use Net::Z3950; if (@ARGV != 2) { print STDERR "Usage: $0 target query\n"; - print STDERR " eg. $0 bagel.indexdata.dk/gils computer\n"; + print STDERR " eg. $0 z3950.indexdata.dk/gils computer\n"; exit 1; } my($host, $query) = @ARGV; -### Database name defaults to "Default" in Net::Z3950 and must be overridden +# Database name defaults to "Default" in Net::Z3950 and must be overridden $host =~ s/\/(.*)//; my $db = $1; my $conn = new Net::Z3950::Connection($host, 0, databaseName => $db) or die "can't connect to '$host': $!"; -### Default format is GRS-1 in Net::Z3950 +# Default format is GRS-1 in Net::Z3950 $conn->option(preferredRecordSyntax => "usmarc"); -### Default format is "B" in Net::Z3950 +# Default format is "B" in Net::Z3950 $conn->option(elementSetName => "F"); my $rs = $conn->search(-prefix => $query) @@ -32,13 +30,13 @@ my $rs = $conn->search(-prefix => $query) my $n = $rs->size(); print "Query '$query' found $n records\n"; -### Note that the record-index is 1-based here, 0-based in ZOOM-C +# Note that the record-index is 1-based here, 0-based in ZOOM-C for my $i (1..$n) { my $rec = $rs->record($i) or die "can't fetch record $i: ", $rs->errmsg(); print "=== Record $i of $n ===\n"; - ### Rendering format for MARC records is different + # Rendering format for MARC records is different print $rec->render(), "\n"; }