-# $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;
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<yaz-client>.
+command-line client, C<yaz-client>. 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<parse()> method to yield parse-trees. The trees are made
up of nodes whose types are subclasses of
C<Net::Z3950::PQF::Node>.
$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();
}
$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
my $this = shift();
my (@msg) = @_;
- $this->{errmsg} = join(@msg);
+ $this->{errmsg} = join("", @msg);
return undef;
}
print $parser->errmsg();
+Returns the last error-message generated by a failed attempt to parse
+a query.
+
=cut
sub errmsg {
=head1 SEE ALSO
+The C<Net::Z3950::PQF::Node> 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