in reply to when is a perl module executed?
A module is compiled when it is used. Anything not inside a sub in the module is executed during the load process.
The actual sequence is complicated slightly by BEGIN blocks which are executed before anything else in the current source file.
Simplistically the execution sequence is: BEGIN blocks, use statements, source code, END blocks. Each source file processed as the result of a use follows the same execution sequence so use statements result in nesting.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: when is a perl module executed?
by ketaki (Acolyte) on Jul 17, 2008 at 03:24 UTC | |
by chromatic (Archbishop) on Jul 17, 2008 at 05:00 UTC | |
by GrandFather (Saint) on Jul 17, 2008 at 03:30 UTC | |
by ketaki (Acolyte) on Jul 17, 2008 at 03:33 UTC | |
by massa (Hermit) on Jul 17, 2008 at 10:51 UTC | |
by Anonymous Monk on Jul 17, 2008 at 05:13 UTC | |
|