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

Re^3: Syntax checking without BEGIN blocks

by bluto (Curate)
on May 01, 2006 at 19:07 UTC ( #546733=note: print w/ replies, xml ) Need Help??


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

If you are worred about incompetance or malice, you better visually inspect the module and the Makefile that comes with it (I certainly do). Syntax checking is great for finding bugs during compiling your own code, but don't confuse it with keeping things safe. In fact the safest code is code that fails a syntax check.

Syntax checking can't stop someone from writing syntactically correct, non-BEGIN block, destructive code. All they have to do is bury something like system("rm -rf *") in the module somewhere and you will have lots of fun trying to find out why your system doesn't work.


Comment on Re^3: Syntax checking without BEGIN blocks
Re^4: Syntax checking without BEGIN blocks
by Anonymous Monk on May 01, 2006 at 21:16 UTC
    Syntax checking can't stop someone from writing syntactically correct, non-BEGIN block, destructive code. All they have to do is bury something like system("rm -rf *") in the module somewhere and you will have lots of fun trying to find out why your system doesn't work.

    True. However, if the code doesn't pass a basic syntax check, I don't need to waste my time deciphering it. I know it doesn't run. If it is code that's syntactically correct, something might be using it...

      True. However, if the code doesn't pass a basic syntax check, I don't need to waste my time deciphering it. I know it doesn't run. If it is code that's syntactically correct, something might be using it...

      If I'm not worried about the code doing anything dangerous then there is no difference to me between a compile-type error and a run-time error. Both will show up in my test suite.

      If I am worried about the code I'm going to have to understand it - whether it is "syntactically" correct or not.

        If I am worried about the code I'm going to have to understand it - whether it is "syntactically" correct or not.

        If it's not "syntactially" correct; it's not code. It's either unused, or data provided to something that is code. I need to understand the code; then I can learn what it does with the data.

        Debugging data is a futile waste of time. Debugging code is not.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (13)
As of 2014-10-23 21:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (129 votes), past polls