Re: (re Mail::Reporter INIT block ) Re: Mail-Box-2.057 errors
Mark Overmeer <[email protected]> Tue, 21 Sep 2004 09:30:11 +0200
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Organization | MARKOV Solutions |
| Message-ID | <[email protected]> |
* DH ([email protected]) [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. Leaving INIT away is probably better in some cases (like web) and having it in is better in other, but how to solve both? -- MarkOv ------------------------------------------------------------------------ drs Mark A.C.J. Overmeer MARKOV Solutions [email protected] [email protected] http://Mark.Overmeer.net http://solutions.overmeer.net