A CGI script is as simple to write as any other Perl script. The dearth of "how to write CGI scripts" information on the Web is due only to the fact that, since a CGI script can be written in any language, the answers vary from language to language. Well, here's One Way To Do It with Perl.
First off, here's our silly test form. Don't forget to read the source.
Now, here's the silly CGI script that runs behind it.
And here's a commented version of that CGI script.
Not much going on there, huh? The CGI is simple. Output just goes to the user's screen, as a page on their web browser. Here's all the important information:
print "Content-type: text/html\n\n";
eval
or system()
statements in your CGI
script until you've read this article on CGI security.