in reply to CGI on the console

For debugging CGI,
use CGI::Carp qw/fatalsToBrowser/;
can be quite helpful.

Instead of getting a 500 error, you should get a screen with error messages. Doesn't work in all situations, especially when you're getting the error because the web server isn't executing the script at all.

Some things that might cause that...
- shebang line (does /usr/local/bin/perl really exist?)
- execute permissions on the file (chmod)
- apache ExecCGI directive for the file's location
- apache's access and suexec log (file owned by correct user/group?)

Good Luck