in reply to Perl and code reviews

Perhaps, in the absense of a way to actually pre-compile Perl code, you could use perl -c. To me, this has about the same amount of value as a "make sure it builds" test -- a basic sanity check. If code successfully builds, it may still have bugs [master of understatement, I know], but at least the extremely obvious ones -- the ones that the compiler can catch -- are taken care of. Likewise with perl -c.

Replies are listed 'Best First'.
Re^2: Perl and code reviews
by hardburn (Abbot) on Aug 18, 2004 at 20:54 UTC

    I wouldn't have a problem with perl -c if not for the existance of BEGIN, which still runs code under the -c switch. If you're doing this as part of an automated system for your company's developers, you can probably trust them not to put evil code into a BEGIN block (at some point, you just have to trust your employees). However, there is the potential that the BEGIN will have some side-effect that you need in the application, but shouldn't be done as part of a simple sanity check. Off the top of my head, I can't think of anything but contrived examples, though.

    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.