Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^4: Syntax checking without BEGIN blocks

by Roy Johnson (Monsignor)
on May 02, 2006 at 16:09 UTC ( #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.


Comment on Re^4: Syntax checking without BEGIN blocks
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.

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.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-07-14 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (255 votes), past polls