in reply to What is an INIT block?

In Chapter 18 of the Camel Book it is said:

1. The compilation phase
(...) BEGIN blocks are handed off to the interpreter to be run as soon as they are parsed, which effectively runs them in FIFO order. (...) Any CHECK, INIT and END blocks are scheduled by the compiler for delayed execution. (...) At the end of this phase, the interpreter is again called up to execute any scheduled CHECK blocks in LIFO order.

2. The code generation phase.
CHECK blocks are installed by code generators, so this optional phase occurs when you explicitly use one of the code generators. These convert the compiled (but not yet run) program into C source code or serialized Perl byte codes.

4. The Execution phase.
(...) At the start of this phase, before your main program gets to run, all scheduled INIT blocks are executed in FIFO order. Then your main program is run. (...) When your main program finishes, any delayed END blocks are finally executed, this time in LIFO order.

Such are the words which can be found in the Camel Book.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law