<form method="POST" action="/cgi-bin/geom.pl">
This indicates that the deamon should send all information to the file geom.pl which is located in the /cgi-bin directory. You may remember that the extension .pl indicates a Perl program. Perl is commonly chosen to interpret HTML forms because it is easy to write and modifiy and because it interfaces very easily with HTML ! The Perl CGI routines (and others) are easily available on the Web - this saves you from reinventing the wheel.
The Perl script contains instructions for Perl to extract relevant data and send it back to the server. Should the script need to interface with other programs or do something Perl does not per se understand, then the Perl interpreter looks in the Perl CGI library for the appropriate CGI routines. The programmer needs to include this library in the script with the following command (the syntax and result being similar to that of a C program):
Note that to receive data, Perl scripts must accept it from STDIN ; conversely, to output data they must send it to STDOUT. The Perl script need not echo data back to the server. It is also possible to start external programs - in the example above, I have shown that data could be rerouted to the geometry program.
To Next Page
Back to Index