CIW Application Developer Series:

Fundamentals of CGI Using Perl (CIWCGI)

Fundamentals of CGI Programming Using Perl is a three-day course that teaches students how to use Common Gateway Interface (CGI) Perl programs and scripts on a Web server. Students will learn how to write print-to-screen scripts, customize Web page hit counters, create and use business forms that interact with text files, manipulate data in a database, work with a relational database via Open Database Connectivity (ODBC), and explore Web server security issues related to CGI files.

Target Audience

Webmasters, software developers, application programmers, client/server developers, and desktop publishers.

Job Responsibilities

Implement and maintain hypertext-based Web sites using authoring and scripting languages; apply human-factors principles to design; create Web content; and use Web management tools and digital media tools.

Prerequisites

Students must have CIW Foundations certification or equivalent experience, and have completed the Web Languages series (JavaScript Fundamentals and Perl Fundamental) or have a working knowledge of client-side scripting, JavaScript or VBScript.

Topics

Application Development Fundamentals

  • The Application Development Process
  • Platforms, Languages and Protocols
  • Client-side Versus Server-side Scripting
  • Hypertext Transfer Protocol

Introduction to CGI and Perl

  • Web Architecture Overview
  • What Is CGI?
  • Why Use CGI?
  • What Is Perl?
  • Why Use Perl?

Creating a Simple Script

  • Key Concepts and Syntax

Perl Fundamentals

  • Accessing Environment Variables
  • Using CGI.pm to Access Environment Variables
  • The if Statement
  • Logical Expressions
  • Pattern Matching
  • Perl Arrays
  • Passing Values to Functions
  • Associative Arrays
  • Loops

Perl File Input and Output Capabilities

  • File IO Using File Handles
  • File Modes
  • Using Files in Scripts
  • Creating a Hit Counter

Controlling Processing and Output

  • Introduction to CGI.pm
  • Incorporating HTML into Perl using CGI.pm
  • Using CGI.pm to Access Form Data
  • Processing User-Entered Data
  • Using One File to Create and Process an HTML Form
  • Using Perl to Validate Form Input
  • Testing Your Script Offline

Saving User-supplied Data to a File

  • Saving Form Data to a File
  • Modifying Form Data
  • Pattern Matching Revisited

Reading a File

  • Introduction to Data Reading
  • Pattern Matching with Regular Expressions
  • Substitution

Introduction to Databases

  • Introduction to Database Programming
  • Four Steps to Interacting with Databases
  • Connecting to Databases
  • Quoting Revisited
  • Querying Table and Field Names
  • Web Database Query Example

Deleting and Inserting Database Records

  • Modifying Data in a Database
  • The do Method
  • Web Database Control Example

CGI Security Issues

  • Type of Attacks
  • Securing the CGI Script
  • Securing the Server
  • Securing Form Data
  • Securing Data Passed to Commands

Resources (Appendix)

  • Installing Apache Server
  • Installing Perl on UNIX and Win 32
  • Requirements Documents