Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Is there a perl(cgi) scripts validator(like W3C html validator), which test cgi script syntax validity, also provide some cleaning and optimizing features? My script works normally, and I have no any objections against it, but I just would like test syntax, slightly optimize it, probably clean from casual crossings out.

Replies are listed 'Best First'.
Re: Perl script validator
by castaway (Parson) on Dec 18, 2004 at 18:48 UTC
Re: Perl script validator
by gaal (Parson) on Dec 18, 2004 at 18:48 UTC
    perl -c + perltidy?
Re: Perl script validator
by atcroft (Abbot) on Dec 18, 2004 at 18:52 UTC

    For just checking if the syntax is clean, you could try perl -c filename. For cleaning up the code format-wise, you might want to look at PerlTidy. Hope that helps....

      My host does not support PerlTidy.
Re: Perl script validator
by thor (Priest) on Dec 19, 2004 at 17:03 UTC
    While I wholeheartedly agree with the 'perl -c' statements above, they are not a panacea. Because you can have run-time generated subroutines, perl -c doesn't bother to check whether or not the ones you called are valid or not. You'll find that out at runtime though...:).

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come

Re: Perl script validator
by uksza (Canon) on Dec 19, 2004 at 23:00 UTC