The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

NexTrieve::Querylog - handle NexTrieve as a querylog

SYNOPSIS

 use NexTrieve;
 $ntv = NexTrieve->new( | {method => value} );
 $querylog = $ntv->Querylog( file | $resource );

 while (!$querylog->eof) {
   $query = $querylog->Query;
 }

DESCRIPTION

The Querylog object of the Perl support for NexTrieve. Do not create directly, but through the Querylog method of the NexTrieve object.

When NexTrieve is run as a server process (see the NexTrieve::Daemon module), a log of queries is kept. This module operates on such a log file and returns NexTrieve::Query objects from a such a log file.

OBJECT METHODS

These methods return one or more objects.

Queries

 @query = $querylog->Queries;

The "Queries" object returns a list of NexTrieve::Query objects of all queries that were logged in the log file that was indicated upon creation of the NexTrieve::Querylog object, or which has been specified by the filename method.

See the documentation of the NexTrieve::Query module for more information.

Query

 $query = $querylog->Query;
 ($query,$localtime) = $querylog->Query;

The "Query" object returns the next NexTrieve::Query object of the queries that were logged in the log file that was indicated upon creation of the NexTrieve::Querylog object, or which has been specified by the filename method.

If there are no more queries to be found in the query log file, then an undefined value is returned. It is also possible to call the eof method to find out whether there are any more queries available before calling the "Query" method.

If called in a list context, the time (as a localtime() string) when the query was originally done, is also returned as the second output parameter.

See the documentation of the NexTrieve::Query module for more information.

OTHER METHODS

These methods allow you to check or change other aspects of the NexTrieve::Querylog object.

eof

 $atendoffile = $querylog->eof;

The "eof" method returns true if there are no more queries left in the NexTrieve::Querylog object to be returned by the Query method.

Please note that if the Queries method was used, this method will always return true.

filename

 $querylog->filename( filename );
 $filename = $querylog->filename;

The "filename" method can be used to change to another query log file or to specify the first query log file if none was specificied when the NexTrieve::Querylog object was created.

AUTHOR

Elizabeth Mattijsen, <liz@dijkmat.nl>.

Please report bugs to <perlbugs@dijkmat.nl>.

COPYRIGHT

Copyright (c) 1995-2002 Elizabeth Mattijsen <liz@dijkmat.nl>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

http://www.nextrieve.com, the NexTrieve.pm and the other NexTrieve::xxx modules.