in reply to
Re: Request help for work around for bug in perl 5.10.1 (weak magic)
in thread [Solved] Request help for work around for bug in perl 5.10.1
So I apologize for the lack of clear error messages. The code is detached, so I have to trap __DIE__ and write to syslog. This is done as follows:
$SIG{__DIE__} = \&die_catcher;
...
#
# die_catcher
#
# Try to log the call stack if we die
#
sub die_catcher {
for my $caller ( CallStack() ) {
alog(LOG_ERR, $caller);
}
}
...
#
# Courtesy of Perl Monks http://www.perlmonks.org/?node_id=51097
#
sub CallStack {
local $@;
eval { confess( '' ) };
my @stack = split m/\n/, $@;
shift @stack for 1..3; # Cover our tracks.
return wantarray ? @stack : join "\n", @stack;
}
I'm not really that familiar with Carp, I'll see what I can figure out to make it give a more complete backtrace.