Trying to troubleshoot perl scripts ?
Add the following to the top of the perl / cgi script:
use CGI::Carp qw(fatalsToBrowser);
Then errors should be redirected to browser rather then getting a 500 error.
Finaly, check if the script runs on the command line and check for errors: