Jesper,
next time when you reply, please remember to reply or CC: the group

On Tuesday 23 December 2003 12:17, Jesper Noehr wrote:
> Hey David.
>
> Thanks for your reply.
>
> It seems you're overriding the sub within a package. Is that necesarry?

no. it isn't. i put it in the package just for demo.

> Can't you just do it in the top of the program, using the module?

yes.

>
> You can see my code here:
> http://cvs.sunsite.dk/viewcvs.cgi/phemail/contrib/yadda/yadda?rev=1.6&conte
>nt-type=text/vnd.viewcvs-markup
>
> Basicly, I use the module Mail::Audit that does exit(); instead of
> return();, so I cannot catch the exit-code.
> I redeclare exit() to die() instead, so I can read the exit-code.

i have never used Mail::Audit so i am not familiar with it. looking at your 
code, i am almost certain that this:

CORE::exit;

is your problem. CORE::exit refers to the built-in exit function which halts 
execution of your problem. since you have already overridden the built-in 
exit, there is no need for that. you simply need to:

exit;

which calls your defined sub.

>
> The problem is, that any calls within Mail::Audit to exit(); are treated
> as the REAL exit, and not the one I defined.
>

again, because i am not familiar with Mail::Audit i can't say for sure what 
Mail::Audit is doing but your CORE::exit is certainly problematic.

david


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to