in reply to Problems with 500 server errors

Lots of 500 errors stem from file permissions. Make sure your USERFILE is read/writable by the user that gets assigned to httpd (normally you need to make it 666 on a *nix box. The script itself has to be executable, but you probably know that.

The other most common thing would be that your program prints anything before it prints a valid HTTP header. In this case your program doesn't print anything at all....

Two good sources for debugging this are (1) the http error log on your server. (Location varies from server to server -- RedHat installs it in /var/log/httpd/error_log) and (2) the Carp module. While you are in a debugging phase, it can help enormously to put

use Carp qw/fatalsToBrowser/;
at the top of your program. This sends any run-time errors to the browser window. Compiler errors will have to be seen in the error log, though.