More Details on Calling CGI Programs

So far, you've learned two different techniques for starting a CGI program. The first and most obvious is simply to call the CGI program's URL from a link or have the user type it in the browser. A line like this will start and run a CGI program called time.cgi:

<A HREF="http://server/cgi-bin/time.cgi">Click here for the time</A>

When this link is followed, the web server runs the CGI program time.cgi, and its output is displayed as a new web page. This example is simple, easy, and straightforward—just like the “Hello, World!” CGI program in Hour 17, “Writing Modules.”

The other way to start a CGI program is to make it the target of an HTML form. For example, the following form calls the CGI program process.cgi ...

Get SAMS Teach Yourself Perl in 24 Hours THIRD 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.