Syntax check in Perl and Python

I work a lot with python and perl scripts. One time I searched a solution to check syntax of written scripts automatical. First of all to check it on console after creating a new one or updating an old one. Second possibility I’m thinking about is to configure it in Jenkins and use it at automatic build calls. At both languages exists the option -c.


At Python you can call

python -c "__import__('compiler').parse(open(’/path/to/’).read())" 

in console.


At Perl it is a little bit smaller:

perl -c /path/to/
comments powered by Disqus