Mike Gossland’s Perl Tutorial Course for Windows

Chapter 5. Introduction to CGI

Introduction to CGI
First Page to Browser
Printing HTML
Serving HTML Files
Serving Edited Files

Introduction to CGI

The rest of this introductory Perl course will describe how you can make Perl interact with a browser through the Common Gateway Interface, or CGI.

CGI is a standard interface that sits between the web browser and the web server. When the browser makes a request of the server, all of the request details flow into the server through the input interface of the CGI. When the server responds with its output, the information flows back out through the output interface of the CGI.

When Perl responds to a browser request it sends output to STDOUT which is sent through CGI back to the browser. Because you know how to print data to STDOUT, you can already work with CGI at its most basic level: sending data to it. It is no more complicated than printing to STDOUT.

The real challenges are learning how to interact with the data that comes in, and how to create useful content. We will learn this later, but for now, we will start by printing some very simple text to a browser window.

If you have not yet installed your Web Server and set it up to work with Perl according to the Perl Via Server instructions then you might as well stop to take the time to do it now. You won't be able to do any more of the course until you do.

See you when you are ready.

Google
just this site the whole web

Questions? Feedback?

Email me your comments!