in reply to MyModule::BEGIN calls

Lemme guess... you use MyModule 74 times. BEGIN blocks are called for one very well defined reason: the module is parsed (prior even to completing compilation.)

Updated: Never mind; see integral's correction, below.

Replies are listed 'Best First'.
Re: Re: MyModule::BEGIN calls
by integral (Hermit) on Dec 08, 2003 at 19:39 UTC

    BEGIN blocks are called during compilation, since use internally uses the same mechanisms as require, modules are only loaded once. This means that top-level code and BEGIN blocks in the module are only executed once. This means that even 74 use MyModule statements aren't going to run those BEGIN blocks more than once.

    --
    integral