X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=test-pod.pl;h=e37a98d51a28b109a22c2f41c5f36e3021ebc7a8;hp=37c54efe6f845f73dc9d78e1c875ea70c8612a5f;hb=c58001648aac84080f3342a1956416cea49fcd5e;hpb=306dd541a159b4d5ad75ab433867cbcc385311cd diff --git a/test-pod.pl b/test-pod.pl index 37c54ef..e37a98d 100644 --- a/test-pod.pl +++ b/test-pod.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# $Id: test-pod.pl,v 1.5 2006-05-10 13:33:13 mike Exp $ +# $Id: test-pod.pl,v 1.7 2006-05-10 15:55:19 mike Exp $ # # Run like this: # YAZ_LOG=pod perl -I lib test-pod.pl "bagel.indexdata.com/gils" "bagel.indexdata.com/marc" @@ -10,10 +10,17 @@ use warnings; use ZOOM::Pod; +if (@ARGV == 0) { + printf STDERR "Usage: $0 [ ...]\n"; + exit 1; +} + +ZOOM::Log::mask_str("appl"); my $pod = new ZOOM::Pod(@ARGV); $pod->option(elementSetName => "b"); $pod->callback(ZOOM::Event::RECV_SEARCH, \&completed_search); $pod->callback(ZOOM::Event::RECV_RECORD, \&got_record); +#$pod->callback(exception => \&exception_thrown); $pod->search_pqf("the"); my $err = $pod->wait(); die "$pod->wait() failed with error $err" if $err; @@ -50,6 +57,12 @@ sub got_record { return 0; } +sub exception_thrown { + my($conn, $state, $rs, $exception) = @_; + print "Uh-oh! $exception\n"; + return 0; +} + sub request_records { my($conn, $rs, $state, $count) = @_;