This module discussed Perl interfaces with CGI and the Web browser.
You learned techniques for maintaining the state of the user using hidden fields with the state-machine model and how to use cookies to keep track of users between sessions. In the next module, you will learn how Perl uses streams and pipes to read and write to files and other programs.
You will also write a program to send email from a form, instead of using a
mailto:
URL.
- Common Gateway Interface (CGI)
Common Gateway Interface (CGI) is a standard method used to generate dynamic content on web pages and web applications.
CGI, when implemented on a web server, provides an interface between the web server and programs that generate the web content.
These programs are known as CGI scripts or simply CGIs; they are usually written in a scripting language, but can be written in any programming language.
CGI or Common Gateway Interface is what make the forms work and the counters count. There are many languages that could function as a CGI language like Perl, C, C++, Tcl, or a Unix Shell Script. By this time, you have learned about Perl and are wondering what is the relation between CGI and Perl.
CGI scripts can be written in a variety of computer languages, but Perl is without dispute the most widely used language for CGI scripting.
Now let us see how to use Perl with Forms and other HTML elements. When you know Perl, you can do things like create small programs and read the programs of others without any additional knowledge.
If you want to learn how to use Perl as a CGI language, continue reading.