The stupid question is the question not asked | |
PerlMonks |
Re^5: Testing if Perl Code is Valid - but don't execute!by JavaFan (Canon) |
on Aug 13, 2010 at 08:01 UTC ( [id://854853]=note: print w/replies, xml ) | Need Help?? |
Well, duh, you got to finish parsing the file to know whether it's valid or not.
For the example given though, you don't to execute more than the BEGIN block. That is, afterall, exactly what perl -c does. It executes the BEGIN, parses the file, and then, 100% of the time, tells you whether the file contains a valid Perl program or not.
In Section
Seekers of Perl Wisdom
|
|