in reply to works as a perl script, but not as cgi
Did you try running your cgi script from the command line?
Grab a shell and head to your webserver, the script may give you extra warnings etc to STDERROR (which, as ikegami points out appear in the logs)
|
|---|