J
Jo Oberman
Me and my cgi-script have the following problem.
I'm using the package CGI::Carp (which installs internally some
$SIG{__DIE___} handlers).
In addition my script defines an own handler methods for
$SIG{__DIE__}.
My suggestion was, that my definition is "overwritting" the defintion
of CGI::Carp.
But that doesn't seem to be right.
Here is my example:
Perl-Skript:
---------------
use CGI::Carp;
$SIG{__DIE__} = \&myDie;
sub myDie {
print "<b>ERROR-Message: $_[0]</b>";
}
eval {
print "Content-type: text/html\n\n";
print "Just some text<br>";
die "I'm dying. Please help!";
print "some text never shown";
};
When running the skript I get the following message (notice the wrong
module and line number)
Just some text
ERROR-Message: I'm dying. Please help! at
d:/dev_soft/apache/Perl/lib/CGI/Carp.pm line 301.
So it seems that the CGI:Carp definition of $SIG{__DIE__} is somewhat
alive. It is called before my own signal-handler is activated.
What is the way to undo the CGI::Carp handler definitions?
Just wanna know 1.) why CGI::Carp::die handler is still active when I
overwrite it with my own handler and 2.) how I can
prevent it?
By the way:
The above example-script simplifies the core problem for discussion!
In real life there are two scripts installed running under mod_perl.
One of it uses CGI::Carp. The otherone defines the signal handler.
Thanks and Greetings!
I'm using the package CGI::Carp (which installs internally some
$SIG{__DIE___} handlers).
In addition my script defines an own handler methods for
$SIG{__DIE__}.
My suggestion was, that my definition is "overwritting" the defintion
of CGI::Carp.
But that doesn't seem to be right.
Here is my example:
Perl-Skript:
---------------
use CGI::Carp;
$SIG{__DIE__} = \&myDie;
sub myDie {
print "<b>ERROR-Message: $_[0]</b>";
}
eval {
print "Content-type: text/html\n\n";
print "Just some text<br>";
die "I'm dying. Please help!";
print "some text never shown";
};
When running the skript I get the following message (notice the wrong
module and line number)
Just some text
ERROR-Message: I'm dying. Please help! at
d:/dev_soft/apache/Perl/lib/CGI/Carp.pm line 301.
So it seems that the CGI:Carp definition of $SIG{__DIE__} is somewhat
alive. It is called before my own signal-handler is activated.
What is the way to undo the CGI::Carp handler definitions?
Just wanna know 1.) why CGI::Carp::die handler is still active when I
overwrite it with my own handler and 2.) how I can
prevent it?
By the way:
The above example-script simplifies the core problem for discussion!
In real life there are two scripts installed running under mod_perl.
One of it uses CGI::Carp. The otherone defines the signal handler.
Thanks and Greetings!