cgi-lib.pl - The Standard Library for CGI Scripts
This section describes the de facto standard library, cgi-bin.pl, for Perl CGI scripts. It also provides a tutorial on how to download and install cgi-bin.pl 2.18 to the Apache server on a Windows system.
If you want to develop Web applications with Perl, you should download and use the CGI de facto standard library,
cgi-lib.pl developed by Steven E. Brenner.
The cgi-lib.pl library makes CGI scripting in Perl easy enough for anyone to process forms
and create dynamic Web content. The library has the following features:
- Extremely simple to learn and easy to use
- Designed for operation under Perl5 and Perl4
- Very efficient
- Compatibility with all CGI interactions, including File Upload
- Convenient utility functions
- Compatible with Perl5 security features such as taint, warnings,
(command line options -Tw) and use strict;
- Debugging facilities
- Good starting point for migration to more sophisticated libraries
Here is what I did to download and install cgi-lin.pl 2.18:
1. Go to http://cgi-lib.berkeley.edu/.
2. Click the link "Version 2.18" in the "Current versions of cgi-lib available" section.
The source code of cgi-lib.pl will be displayed in the browser.
3. Click "File > Save as" from the browser menu. The Save As dialog box shows up.
4. Save the content to C:\local\apache\cgi-bin\ directory and rename it to cgi-bin.pl.
See the next section for testing the cgi-bin.pl installation.
Last update: 2014.
Table of Contents
About This Book
Perl on Linux Systems
ActivePerl on Windows Systems
Data Types: Values and Variables
Expressions, Operations and Simple Statements
User Defined Subroutines
Perl Built-in Debugger
Name Spaces and Perl Module Files
Symbolic (or Soft) References
Hard References - Addresses of Memory Objects
Objects (or References) and Classes (or Packages)
Typeglob and Importing Identifiers from Other Packages
String Built-in Functions and Performance
File Handles and Data Input/Output
Open Files in Binary Mode
Open Directories and Read File Names
File System Functions and Operations
Converting Perl Script to Executable Binary
Using DBM Database Files
Using MySQL Database Server
Socket Communication Over the Internet
XML::Simple Module - XML Parser and Generator
XML Communication Model
SOAP::Lite - SOAP Server-Client Communication Module
Perl Programs as IIS Server CGI Scripts
CGI (Common Gateway Interface)
XML-RPC - Remote Procedure Call with XML and HTTP
RPC::XML - Perl Implementation of XML-RPC
►Integrating Perl with Apache Web Server
Downloading Apache HTTP Server 2.2.25 for Windows
Installing Apache HTTP Server 2.2.25 on Windows
Publishing HTML Documents as Web Pages
Starting and Stopping Apache Server
Running Perl Scripts in "cgi-bin"
printenv.pl - Testing Perl CGI Environment
500 Internal Server Error
►cgi-lib.pl - The Standard Library for CGI Scripts
ReadParse() - Parsing Web Form Input Values
Running Perl Scripts in "htdocs"
CGI.pm Module for Building Web Pages
LWP::UserAgent and Web Site Testing
PDF Printing Version