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.
In reply to Re: when is a perl module executed?
by GrandFather
in thread when is a perl module executed?
by ketaki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |