in reply to Re: Understanding order of module compilation and execution
in thread Understanding order of module compilation and execution
So, if the script has "use A;" before "use B;", the compiler will complile "A" first (and during that compilation, it will compile any 'used' modules in A), then, when it has compiled A, it will compile B.
Not quite. The compiler may *start* compliling "A" first, but it will not necessary compile all of "A" first. Even without using circular references.
# main.pl use ModA; use ModB; # prints B A 1;
# ModA.pm package ModA; use ModB; print("A\n"); 1;
# ModB.pm package ModB; print("B\n"); 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Understanding order of module compilation and execution
by Perl Mouse (Chaplain) on Dec 16, 2005 at 18:06 UTC | |
by ikegami (Patriarch) on Dec 16, 2005 at 20:01 UTC |