Path: usenet.cis.ufl.edu!usenet.eel.ufl.edu!psgrain!nntp.teleport.com!usenet
From: Alan Stebbens <
[email protected]>
Newsgroups: comp.lang.perl.announce,comp.lang.perl.misc
Subject: ANNOUNCE: Query.pm; Perl 5 module for generalized queries
Followup-To: comp.lang.perl.misc
Date: 21 Sep 1995 14:35:35 GMT
Organization: Teleport - Portland's Public Access (503) 220-1016
Lines: 73
Approved:
[email protected] (comp.lang.perl.announce)
Message-ID: <
[email protected]>
Reply-To: Alan Stebbens <
[email protected]>
NNTP-Posting-Host: linda.teleport.com
X-Disclaimer: The "Approved" header verifies header information for article transmission and does not imply approval of content.
Xref: usenet.cis.ufl.edu comp.lang.perl.announce:127 comp.lang.perl.misc:6828
This is to announce a new Perl 5 module, Query.pm, which is available at
ftp://hub.ucsb.edu/pub/prog/Query.shar
The following is the README file accompanying it.
------------------------------
This file describes the Query.pm Perl 5 module, which performs
generalized queries on various kinds of values. Validation and
normalization of input, based on the type, is automated, as is
error reporting and re-solicitation of input.
Input of '?', unless configured otherwise, provides useful,
helpful information, based on the expected input type, even in
the absence of a programmer-supplied help string.
There is one primary subroutine, called "query", which is passed
a prompt and some "flags", optionally followed by addtional
arguments, depending upon the particular flags.
The flags are single characters which indicate:
* input type: integer, real, string, yes-no, keyword, or
non-keyword;
* default input, in the absence of user input;
* help string, to be reported for errors or input of
'?';
* input validation, such as regexp matching, maximum
length, and "check" subroutine calls;
* input handling, such as blank squeezing, and "before"
subroutine calls.
* name of the variable to be set with the validated input.
An accompanying subroutine, query_table, can be passed an array
of of arguments which will be interatively passed to query,
allowing for easy generation of table-driven query-response input
routines.
The subroutine query_table_set_defaults can be used on a query
table array to cause any mentioned variables to be initialized
with any mentioned default values. This is handy for having a
single table defining variables, their default values, and the
validation criteria for setting new values.
The subroutine query_table_process can be used on a query table
array to process the array in a complete general fashion.
Complete details are provided within the module, in the Perl 5
"pod" format. Traditional man pages are available with the
command:
pod2man Query.pm | nroff -man -
The code was developed and requires Perl5.001m (eg: it uses
references).
The library is available under the GNU General License, Version
2, and is located at:
ftp://hub.ucsb.edu/pub/prog/Query.shar
Suggestions or improvements are welcome.
_______________________________________
Alan K. Stebbens <
[email protected]>
College of Engineering
University of California, Santa Barbara