Hour 4. Writing Your First CGI Program

In the previous hour, I explained how to make sure your CGI environment is configured and running properly, and how to adapt CGI programs downloaded from the Internet to work properly in that environment. In this hour, you’ll get your first real look at developing CGI programs from scratch. I’ll also provide you with a brief overview of Perl programming that will help non-Perl programmers understand how the programs in this book work. This hour covers

  • The structure of a basic CGI program

  • How to write a program that redirects a user to a new URL

  • How redirection of input and output works

  • How to deal with filehandles in Perl

  • How Perl loops and conditional statements work

  • How to use Perl expressions

Get Sams Teach Yourself CGI in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.