in reply to loading modules using 'use'
There's not a single compile-time. When one says "at compile-time", one means "when the containing unit (statement, block, file) is being compiled". Same goes for run time.
is basicallyuse A;
BEGIN { require A; A->import(); }
use statements and BEGIN blocks are executed as soon are they are compiled, so the following happens
As you can see, Exporter is loaded and its import method is compiled before your module's import is called without having to make any modifications.
(I usually use "ModA" instead of "A" because "B" is the name of an existing module.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: loading modules using 'use'
by angshuman (Novice) on Jul 12, 2010 at 11:57 UTC | |
by ikegami (Patriarch) on Jul 12, 2010 at 22:20 UTC | |
by angshuman (Novice) on Jul 13, 2010 at 03:15 UTC | |
by ikegami (Patriarch) on Jul 13, 2010 at 03:42 UTC |