I'm working in a project that shall have +- the time of the Internet has we
now it today. 
Sometimes my script throw a die and I just know the line where was throw.
What I want is to have the all stack, something like java. 
Since changing the code would be a very expancive work, I would prefer to
add some information to the die string and let the die do is job.

Thanks
Marcos

-----Original Message-----
From: WC -Sx- Jones [mailto:[EMAIL PROTECTED]
Sent: Friday, March 19, 2004 6:25 PM
To: [EMAIL PROTECTED]
Subject: Re: Overriding 'die' Functions


[EMAIL PROTECTED] wrote:
> I would like to add some text each time someone calls die. in my books
says
> this shoud work
> *CORE::GLOBAL::die = sub {
>    ...
> }
> 
> 
> can someone give me a example?


Are you wantgint to capture die and continue?
Web sites such as the following are disappearing quickly:

http://iis1.cps.unizar.es/Oreilly/perl/cookbook/ch16_18.htm


However, logging errors is better:

use strict;
use Sys::Syslog;

# Set the userID, if known...
my $usrID = `/usr/bin/whoami`;
my $target = @ARGV ? $ARGV[0] : 'unknown';

$|++ = 1;

# Whatever triggered event...

# Log it... (Example only...)
openlog("in.fingerd", "ndelay", "daemon");
syslog("notice",
        "Local %s tried giving the finger request.\n",
        $usrID, $target);

closelog();

__END__

exit;
HTH/Bill

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


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