Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: Syntax checking without BEGIN blocks

by Roy Johnson (Monsignor)
on May 02, 2006 at 16:09 UTC ( [id://546940]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Syntax checking without BEGIN blocks
in thread Syntax checking without BEGIN blocks

doesn't solve the OP's problem
I think it does. He wants to syntax-check code before examining it for security issues. He'd do that for each phase. It's not an all-at-once syntax check, but it does allow syntax-check-before-running.

The reason I don't know the order of processing of special blocks other than BEGIN is that I have no reason to know. I don't use them. Someone who thinks I should look up something I don't use has a serious proctological issue.


Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^5: Syntax checking without BEGIN blocks
by diotalevi (Canon) on May 03, 2006 at 13:53 UTC

    Perl already "syntax checks" things before running them. Compilation is a syntax check. It compiles something first. If it succeeded then it might be run. If it's a BEGIN block then it is run as soon as it has finished being compiled. If you didn't care about any code past the BEGIN block then you could opt to exit before compiling any more code. If you're going to compile more code then it is mandatory to run the BEGIN block so that any subroutine declarations, prototypes, imported functions, or overloaded things are available.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Re^5: Syntax checking without BEGIN blocks
by adrianh (Chancellor) on May 03, 2006 at 10:27 UTC
    I think it does. He wants to syntax-check code before examining it for security issues. He'd do that for each phase. It's not an all-at-once syntax check, but it does allow syntax-check-before-running.

    I don't :-) They want to check everything - note their use case:

    I don't want to start messing with the codebase just to check the debug statement I've added. How do I make perl just check the syntax, and do nothing else?

    and that isn't possible in the Perl world.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://546940]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-03-29 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found