Sure, here's an example:

[snip]

#!/usr/bin/perl -w
use strict;
use Mail::Audit;
use vars qw/$mail @maildata/;
BEGIN { *CORE::GLOBAL::exit = sub { my($exitcode) = shift; print "exit: ".$exitcode; die $exitcode; } };


@maildata = <DATA>;
$mail = Mail::Audit->new(data => [EMAIL PROTECTED]);
eval { $mail->accept("~/pseudomailbox"); };
print "Accept returned: [EMAIL PROTECTED]";
CORE::exit;

__DATA__
To: somebody
Subject: test
From: Jesper Noehr
Organization: Pheritia | Coding Solutions
Content-Type: text/plain; format=flowed; charset=iso-8859-1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Date: Tue, 23 Dec 2003 22:01:27 +0100
Lines: 6

foobar test
test

[/snip]

This program will deliver to ~/pseudomailbox.

As you can see, it exits without any status.

Now, try inserting these 2 lines in the top of Audit.pm:

[snip]
use subs qw/exit/;
sub exit { die shift; }
[/snip]

Should demonstrate the problem.

On Tue, 23 Dec 2003 14:00:53 -0800, david <[EMAIL PROTECTED]> wrote:

Jesper Noehr wrote:

[snip]

are you sure it's the exit function that cause the problem?

Yes, I am positive. As soon as I insert this into Audit.pm it works
perfectly:
use subs qw/exit/;
sub exit { die shift; }

this makes sense but it doesn't make sense that the previous version doesn't
work. can you provide a strip down version of your whole script to
demonstrate the problme?


david



-- Jesper Nøhr - decius <[EMAIL PROTECTED]> Holstebro, Denmark -- http://printf.dk UNIX Administrator, Software Engineer, Geek.

--
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