Monday, June 22, 2009

Check perl syntax from command line

When we run your PERL scripts in browser, we may get “500 Internal Server Error” when something goes wrong.
There would be many reasons for this but Out of many check one thing which we can do very quickly is to check if your PERL script contains errors.

To do it login to server where PERL script running and execute command:
To check syntax
/path/to/perl -wc /path/to/script.cgi

To runtime script
/path/to/perl -w /path/to/script.cgi