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

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.

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

  • Comment on Re^5: Syntax checking without BEGIN blocks