NCCI Perl Documentation GBasic(3)
NAME
GBasic.pl - CGI interface routines - simplified cgi-lib.pl
SYNOPSIS
# Access to modules (see the NOTES section for setup)
BEGIN {
...
push (@INC, "../sys/csbase/lib");
}
require 'GBasic.pl';
# Read any data from the requesting form and then
# pick up the parameters for this script (from form
# data or specified on the URL).
my (%in) = &GBasic::ReadParse;
# Fetch the CGI parameter "FIELD".
my ($fieldValue) = $in{"FIELD"};
DESCRIPTION
This Perl5 library implements a perl interface to the HTTP
Common Gateway Interface (CGI) protocol.
It is similar to the popular cgi-lib.pl, but with some
simplifications:
- The rarely used and cantankerous Mime/Multipart protocol
is not supported.
Functions
%in = ReadParse ()
Reads in GET or POST data, converts it to text (removing
HTTP %xx escape sequences), and puts one key=value in
each member of the %in hash. Duplicate GET or POST
parameters (typically generated from lists which allow
multiple selections) have a single entry in the %in hash
with the individual values separated by '\0'.
XCoordinate ()
YCoordinate ()
Returns the X and Y coordinates for a hit on a clickable
image.
MethGet ()
Return true if this cgi call was using the GET request,
false otherwise.
19/Mar/01 Last change: perl 5.004, patch 01 1
NCCI Perl Documentation GBasic(3)
MethPost ()
Return true if this cgi call was using the POST request,
false otherwise.
MyURL ()
Returns a URL which invoked the CGI script.
CgiError (@msg)
Prints out an error message which which contains
appropriate headers, HTML markup, etcetera.
If no parameters are supplied, CgiError displays a
generic error message. Otherwise, the first parameter
will be the title and the rest will be displayed as
different paragraphs of the body of the generated HTML
page.
dieCgi (@msg)
Identical to CgiError(), but also issues a perl die()
with the supplied error message.
browserFeatureAvailable ($browser, $feature)
Given a browser string as per the environment variable
HTTP_USER_AGENT and a feature:
return 0 for not available
return 1 for available
return 2 for don't recognize feature string
Current supported features are:
'MULTIPART-X-MIXED-REPLACE'
'FRAMES'
WARNING
None
SEE ALSO
G(3)
NOTES
This module has not yet been set up for "installation" in
your local Perl. We currently use a set of conventions for
access to this module, until the install procedures are
developed:
- The source code lives on development and production hosts
in the directory /Volumes/app/cs/csbase/lib.
- By convention, a project maintains perl scripts in
subdirectories of some top-level directory, which we will
19/Mar/01 Last change: perl 5.004, patch 01 2
NCCI Perl Documentation GBasic(3)
call $TOP.
- By convention, projects establish a $TOP/sys directory
which contains a symbolic link from csbase to
/Volummes/app/cs/csbase.
- To get access to the modules, you typically include a
BEGIN of the form:
BEGIN {
...
push (@INC, "../sys/csbase/lib");
}
AUTHOR
Clint Goss <clint@goss.com>, Feb 1997