CGI Programming in Perl

Kirrily Robert

Open Publications License 1.0

Copyright (c) 1999-2000 by Netizen Pty Ltd. Copyright (c) 2000 by Kirrily Robert . This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, vX.Y or later (the latest version is presently available at http://www.opencontent.org/openpub/).


Table of Contents
1. Introduction
Course outline
Assumed knowledge
Module objectives
Platform and version details
The course notes
Other materials
2. What is CGI?
In this chapter...
Definition of CGI
Introduction to HTTP
Terminology
HTTP status codes
HTTP Methods
Exercises
What is needed to run CGI programs?
Chapter summary
3. Generating web pages with Perl
In this chapter...
Your public_html directory
The CGI directory
The HTTP headers
HTML output
Running and debugging CGI programs
Exercises
Quoting made easy
Here documents
Pick your own quotes
Exercises
Environment variables
Exercises
Chapter summary
4. Accepting and processing form input
In this chapter...
A quick look at HTML forms
The FORM element
Input fields
TEXT
CHECKBOX
SELECT
SUBMIT
The CGI module
What is a module?
Using the CGI module
Accepting parameters with CGI
Debugging with the CGI module's offline mode
Exercises
Practical Exercise: Data validation
Exercises
Practical Exercise: Multi-form "Wizard" interface
Exercises
Practical Exercise: File upload
Chapter summary
5. Security issues
In this chapter...
Authentication and access control for CGI scripts
Why is CGI authentication a bad idea?
HTTP authentication
Access control
Exercises
Tainted data
Exercises
cgiwrap
Secure HTTP
Chapter summary
6. Other related Perl modules
In this chapter...
Useful Perl modules
Failing gracefully with CGI::Carp
Exercise
Encoding URIs with URI::Escape
Exercise
Creating templates with Text::Template
Introduction to object oriented modules
Using the Text::Template module
Exercise
Sending email with Mail::Mailer
Exercises
Chapter Summary
7. Conclusion
What you've learnt
Where to now?
Further reading
A. Unix cheat sheet
B. Editor cheat sheet
vi
Running
Using
Exiting
Gotchas
Help
pico
Running
Using
Exiting
Gotchas
Help
joe
Running
Using
Exiting
Gotchas
Help
jed
Running
Using
Exiting
Gotchas
Help
C. ASCII Pronunciation Guide
D. HTML Cheat Sheet