CGI Scripting with Perl

Accelerated Technical Training


Common Gateway Interface (CGI) is the technical term for the the mechanism by means of which programs are invoked on web servers in response to mouse clicks on hyperlinks by users of browsers. CGI programs perform such tasks as database updates, product ordering, survey form completion, and so on. They also generate new web pages -- termed dynamic web pages because these pages are created on the fly by the CGI programs. From the user's perspective, such pages are indistinguishable from hand-written ("static") ones. But for the owners and builders of web sites, CGI programs open vast new possibilities.

This is a technical course for people with Perl programming experience who wish to apply it to the construction of web sites.

The web as a platform upon which to build and deploy applications has many advantages:

  • It is machine-independent; your software will run identically on PCs, Macintoshes, and workstations.
  • It is timely; data and software updates are immediately available.
  • It is easy to deploy; there is no software to distribute, since your applications run on a server and the client software is standard.
  • It is geographically dispersed; physical proximity is irrelevant since the web is indeed World Wide.
  • It is easy for users to learn because browsers are intuitive and already familiar to many.
This course provides the techniques that enable you to gain all these benefits.


1 days



  • Emphasis on practical skills
  • Hands-on


  • This course is for Perl programmers who wish to construct interactive web sites.
  • Prerequisites

    Check the ones your background satisfies:
    Perl -- You know how to write Perl scripts.
    Unix or NT -- You can navigate the filesystem and edit text.
    HTML -- You have written web pages.
    If you checked 2 or more, you're well-equipped to take this class.



    Review of the Basics of Perl

    The Client, the Server, and the Environment

    Techniques for Debugging CGI Scripts

    Processing Form Data

    Dynamic Web Pages

    Non-Parsed Headers

    Interfacing to External Applications



      Upon completion of this course, you will be able to:
      • Process data from HTML forms.
      • Generate dynamic Web pages.
      • Capture form data in files.
      • Send e-mail from Perl scripts.
      • Use the Perl module to make CGI scripting easier.
      • Debug Perl CGI scripts.
      • Optional/Advanced:
        • Use the environment variables set by the Web server.
        • Display data in real time.
        • Add fields to the server's HTTP response header.
        • Lock files to prevent data corruption.
        • Grasp the issues of interfacing to legacy systems.


    1. A great deal of information is covered in a short amount of time. The format is highly compressed, with a focus on hands-on exercises -- the best way to acquire new skills, learning by doing -- that are carefully designed to rehearse the specific techniques of interest without extraneous effort. Source code files are provided to save time typing. Once you get your solution working, you know you have learned -- and proven you've learned! -- each of the essential techniques for programming web-based applications in Perl.
    2. In its method, the course's emphasis is on the practical, with the majority of the classroom time devoted to hands-on activity. You set your own pace, with the instructor acting mainly as a facilitator. Historical and theoretical material is kept to a minimum. The main classroom activity is the step-by-step construction of a web-based work order and invoicing system for a hypothetical business.
    3. Each student receives a copy of the sample programs discussed in the course.
    4. Setup

      Delivery of this class requires:
      • classroom
      • a PC or workstation for each student
      • a PC or workstation for the instructor
      • NT or Unix
      • a data projector for the instructor's computer screen
      • connection to the internet
      • a Perl interpreter and a webserver enabled for CGI
      • Detailed system configuration instructions are available at
      Write to us!
      Updated Wednesday, 31-Oct-2001 13:18:38 MST

      Copyright © DKTS
      Dan Keller Technical Services
      4500 19th St., San Francisco
      California, USA 94114
      voice: 415 / 861-4500