Re: (re Mail::Reporter INIT block ) Re: Mail-Box-2.057 errors

Mark Overmeer <[email protected]> Tue, 21 Sep 2004 10:41:48 +0200
Newsgroups gmane.comp.lang.perl.modules.mail-box
Organization MARKOV Solutions
Message-ID <[email protected]>
* DH ([email protected]) [040921 10:02]:
> > Without INIT block, the code is executed in order of module compilation.
> > This may mean that in some other module an object get's created (probably
> > some signleton) as class variable, before the trace default is set.
> > But
> > that default must be set before the object is created, because it is
> > used in its initiation.
> 
> No it doesn't.  There's no way that can happen.

Well, there are ways it can happen, for instance if there are circular
dependencies between modules.  It is much nicer to put it in a BEGIN or
INIT block, but... ok... I will remove the encapsulation...

> If you're still convinced that it can happen, simply
> assign the appropriate values to 
> my($default_log, $default_trace, $trace_callback);
> when you declare those variables.

Well, the defaultTrace creates dualvar for the constant which is passed.
It is a hassle to do that by hand...
-- 
Thanks for your thoughts,

               MarkOv

------------------------------------------------------------------------
drs Mark A.C.J. Overmeer                                MARKOV Solutions
       [email protected]                          [email protected]
http://Mark.Overmeer.net                   http://solutions.overmeer.net