logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

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

Subject: Re: (re Mail::Reporter INIT block ) Re: Mail-Box-2.057 errors
--- Mark Overmeer <Mark@xxxxxxxxxxxx> wrote:

> * DH (crazyinsomniac@xxxxxxxxx) [040921 09:20]:
> > I'm referring to
> > http://marc.theaimsgroup.com/?l=perl-mailbox&m=109571439727797&w=2
> > 
> > in Mail::Reporter you have
> > 
> >     INIT {  __PACKAGE__->defaultTrace('WARNINGS'); }
> > 
> > the fix is to simply omit the init block and move the
> > call to the end of the file, since
> > the call doesn't need to happen at INIT time.
> 
> 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.
Go ahead and try it out (I tried it, nothing new breaks in the test suite). 
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.





                
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail 




<Prev in Thread] Current Thread [Next in Thread>