Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^5: Testing if Perl Code is Valid - but don't execute!

by JavaFan (Canon)
on Aug 13, 2010 at 08:01 UTC ( #854853=note: print w/replies, xml ) Need Help??


in reply to Re^4: Testing if Perl Code is Valid - but don't execute!
in thread Testing if Perl Code is Valid - but don't execute!

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.

  • Comment on Re^5: Testing if Perl Code is Valid - but don't execute!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://854853]
help
Chatterbox?
[holli]: i am designing an interface. check this out, can you tell immediatly tell me what the code does?
[holli]: scratch one "tell". you decide which ;)
[danaj]: :) Thanks, I should visit more often.
[holli]: you should visit the link i posted and answer my question
[stonecolddevin]: good afternoon all
[holli]: if you know what's good for you
[holli]: hahaha
[stonecolddevin]: hey holli, long time no chat

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2017-09-26 21:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (297 votes). Check out past polls.

    Notices?