When you run your perl scripts in browser you would get “500 Internal Server Error” when something goes wrong. There would be several reasons of this but one thing to be done is to check if your perl script contains errors. To do it login to server you’re running perl script (I hope you use Linux ;] ) and execute command:
/usr/bin/perl -w /path/to/script.cgi
It will show debug information and it would be much easier to find and solve the problem.
You may also be interested in:
Access to sqlite3 database through perl (script example)