in reply to run a CGI script

CGI scripts run in exactly the same way, so you can 'test' them by running them. The key difference is, that each web page _must_ start with a 'content type', and without that your script looks like an error

#!/usr/bin/perl use strict; use warnings; print "Content-Type: Text/HTML\n\n"; print "<H1>Your CGI script is working</H1>\n";

That's the very basics - you don't _have_ to use the 'CGI' module, but ... well, it's there to support CGI scripting, so it's really sensible.

So to get this script to 'work':

And there you have a very basic pair of scripts - but seriously, use CGI as it streamlines a lot of things. Key feature are parameter handling, 'on the fly' form generation, and sending errors to your browser (look at CGI::Carp)

One thing I will say - be extremely careful to sanitise any inputs to your script. Web forms/CGI scripts are VERY good places to end up with security bugs, because they can be exploited remotely, and your CGI script runs as the web server. That means don't trust _anything_ you get from that form.

XKCD says it quite well: http://xkcd.com/327/