in reply to Re: Modules sharing?
in thread Modules sharing?

I'm hesitant about replying as I'm certainly no Perl internals guru. But, from the evidence you've provided in this example, one is forced to come to the conclusion that there is some magic involved with 'use' such that when using files multiple times, the resulting code is actually only loaded and run once.

If this were not the case then you should have gotten several 'loading module TestUtil' lines, and several $LOG = GLOB(someaddress) lines. You didn't, so it works like you want it to. Be glad and rejoice.

-Scott

Replies are listed 'Best First'.
Re^3: Modules sharing?
by eff_i_g (Curate) on Nov 08, 2005 at 20:16 UTC
    by george! you are correct. now i remember seeing an example of this process somewhere, how the compiler skips already-loaded modules. the print statements do make that quite obvious--thanks for pointing that out--hooray! :)