Using the CGI module
The previous example illustrate the underlying mechanisms used to communicate between server and CGI program.
One could go on to use the text processing features of Perl to parse the form data and generate meaningful responses.
In modern Perl you can (and presumably should) use the CGI module to hide many of these details—especially extracting form parameter.