Are you switching into the cgi bin and running the script from your command line, or are you going through a browser (with
http://localhost/cgi-bin/yourscript.pl)?
Also, did you allow for cgi access on the web server? Look in your apache/conf directory at the file httpd.conf. Search through it for [b]cgi[b].
You should find a couple of lines dealing with cgi access. They're commented out by default. Uncomment them, and restart the server. They should be similar to:
ScriptAlias /cgi-bin/ "c:/Apache/cgi-bin/"
and
# To use CGI scripts:
#
AddHandler cgi-script .cgi
(you need to add .pl to that too, if you want to execute .pl files)
AddHandler cgi-script .cgi .pl
--mark