CGIs allow you to process HTML form data with perl. The basic structure for a CGI is as follows:
The CGI feature we covered is ¶m. This basically allows you to get the value out of a name value pair from an HTML form field. If you know the name of the form field, you can assign the value to a variable like this:
$x = ¶m('field_1');
where $x is the variable name, and field_1 is the name part of the name-value pair. ¶m will find whatever value goes with field_1 and sets that as the value fot $x. Practically, field_1 can be called anything you like. it just needs to be the name of a form field (ie input widget) in the form which calls this cgi.
We began covering subroutines as well. This allows you to move a section of code away from the main body. You can execute that code by using the name of the subroutine. For example: