MCslp HomeMCslp Home Contact | About | Help | Legal
Books | Articles | Downloads
News | News Archive
 
 
 
If you want to add a dynamic element to your web site then you can use Perl to generate web pages on the fly. The system you use is called CGI, Common Gateway Interface, and in this chapter you'll find details on how to use the interface within Perl. With the scripts provided in this chapter, you can learn how to write scripts that drive a dynamic, user driven website. You'll even find a script for an online book store!
Download: PC - Unix - Mac - Info
Chapter Script Status

TitleScript NameStatus
The CGI Environment webenv.pl No Change
Processing a GET Request cgiget.pl No Change
Processing a POST Request cgipost.pl No Change
Simple CGI Module SCGI.pm Script Update
Phone List phone.pl No Change
Web News Page Management Interface webnews.pl Script Update
Sending a File Directly via HTTP sendfile.pl No Change
Redirecting URL Requests redirect.pl No Change
The Bookware Online Book Shop bookstor.pl No Change

SCGI Module Update

The SCGI module provides a simplified interface to both POST and GET methods for extracting information from forms. In it's original book state, the script made use of the $QUERY_LENGTH variable to determine the length of the supplied data for eithe method. However, it now turns out that many web servers do not populate this environment value when exchanging information with the CGI script.

Without modification, the original module may, in some cases, fail to recognize the existence of any information passed to it via a web form, especially on POST requests. The modification, available in this package fixes this problem.

Webnews Script Update

There were a number of minor problems with this script. Some are simple typos that have now been resolved. Others though are to do with the logic of the script, and with some Perl versions and under some situations the script will fail to work completely. I've tried to isolate the problems that people are experiencing and cleaned up the script a little. The updated version is available here

 PAA Quick Links
 

Book Summary
Book Outline
Chapter Contents
Chapter and Script Details
Download Chapter 4 Free! (PDF, 540k)

 Buy Perl: The Complete Reference
 

Perl the Complete Reference has been superceded by Perl The Complete Reference 2ed...


Website (c) 1998 and beyond Martin C Brown, MCSLP, UK. All other items, including contributed texts, files and information is the copyright of their respective owners.
Contact Us