From c642d97c7e09e5372f5270c34f35633d39469cf7 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 17 Dec 2004 17:12:05 +0000 Subject: [PATCH] Proofread documentation, fix bug in _error(). --- lib/Net/Z3950/PQF.pm | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/Net/Z3950/PQF.pm b/lib/Net/Z3950/PQF.pm index bbdbc9e..1251acf 100644 --- a/lib/Net/Z3950/PQF.pm +++ b/lib/Net/Z3950/PQF.pm @@ -1,4 +1,4 @@ -# $Id: PQF.pm,v 1.3 2004-12-17 16:58:09 mike Exp $ +# $Id: PQF.pm,v 1.4 2004-12-17 17:12:05 mike Exp $ package Net::Z3950::PQF; @@ -28,9 +28,11 @@ This library provides a parser for PQF (Prefix Query Format), an ugly but precise string format for expressing Z39.50 Type-1 queries. This format is widely used behind the scenes of Z39.50 applications, and is also used extensively with test-harness programs such as the YAZ -command-line client, C. +command-line client, C. A few particularly misguided +souls have been known to type it by hand. -It is simple to use. Create a parser object, then pass PQF strings +Unlike PQF itself, this module +is simple to use. Create a parser object, then pass PQF strings into its C method to yield parse-trees. The trees are made up of nodes whose types are subclasses of C. @@ -69,7 +71,7 @@ sub new { $query = '@and @attr 1=1003 kernighan @attr 1=4 unix'; $node = $parser->parse($query); - if (!defined $node) + if (!defined $node) { die "parse($query) failed: " . $parser->errmsg(); } @@ -81,11 +83,12 @@ of the parse tree is returned. $node2 = $parser->parse($query, "zthes"); $node3 = $parser->parse($query, "1.2.840.10003.3.13"); -A second argument may be provided, after the query itself. If it is +A second argument may be provided after the query itself. If it is provided, then it is taken to be either the name or the OID of a default attribute set, which attributes specified in the query belong -to if no alternative attribute set is explicitly specified. When this -second argument is absent, the default attribute set is BIB-1. +to if no alternative attribute set is explicitly specified within the +query. When this second argument is absent, the default attribute set +is BIB-1. =cut @@ -173,7 +176,7 @@ sub _error { my $this = shift(); my (@msg) = @_; - $this->{errmsg} = join(@msg); + $this->{errmsg} = join("", @msg); return undef; } @@ -197,6 +200,9 @@ sub _term { print $parser->errmsg(); +Returns the last error-message generated by a failed attempt to parse +a query. + =cut sub errmsg { @@ -207,6 +213,8 @@ sub errmsg { =head1 SEE ALSO +The C module. + The definition of the Type-1 query in the Z39.50 standard, the relevant section of which is on-line at http://www.loc.gov/z3950/agency/markup/09.html#3.7 -- 1.7.10.4