3 # See ../README for a description of this program.
4 # perl -I../../blib/lib -I../../blib/arch zoomtst1.pl <target> <query>
10 if (@ARGV < 2 || @ARGV %2 == 1) {
11 print STDERR "Usage: $0 target query [<option> <value> ...]\n";
12 print STDERR " eg. $0 z3950.indexdata.dk/gils computer\n";
15 my $host = shift(@ARGV);
16 my $query = shift(@ARGV);
19 my $conn = new ZOOM::Connection($host, 0);
20 $conn->option(preferredRecordSyntax => "usmarc");
22 my $key = shift(@ARGV);
23 my $value = shift(@ARGV);
24 $conn->option($key => $value);
27 my $rs = $conn->search_pqf($query);
29 print "Query '$query' found $n records\n";
31 my $rec = $rs->record($i);
32 print "=== Record ", $i+1, " of $n ===\n";
39 die "Non-ZOOM error: $@" if !$@->isa("ZOOM::Exception");
40 print STDERR "Error ", $@->code(), ": ", $@->message();
41 print STDERR " (", $@->addinfo(), ")" if $@->addinfo();