in reply to Understanding order of module compilation and execution

You can arrange for your initialisation to occur in a specific order, by the use of BEGIN blocks within the modules and careful arrangement of the ordering of the use statements in the calling code. Basically, BEGIN blocks are called in the order they are seen, so if both A.pm & B.pm have BEGIN blocks, they will get called in whichever order their use statements appear in script.pl.

See Perlmod for the nitty gritty details.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: Understanding order of module compilation and execution