in reply to package compiling
does the subroutine "bar" run every time I put use Model::Conf in other packages?
If you use or require the module, Perl keeps tracks of already loaded modules (in %INC), so the code is loaded/compiled/executed only once.
(do EXPR also adds an entry in %INC, but doesn't check itself before loading, so with do the module's code would be executed several times.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: package compiling
by simonodell (Acolyte) on Apr 13, 2011 at 17:21 UTC | |
by Eliya (Vicar) on Apr 13, 2011 at 17:30 UTC | |
by simonodell (Acolyte) on Apr 13, 2011 at 20:34 UTC | |
by FunkyMonk (Bishop) on Apr 13, 2011 at 20:46 UTC |