OK, I can see the advantage of the Apache specific stuff. However, in
looking at your code, I think you may not be taking into account a lot of
eval logic that CGI::Carp has. Eval logic is the hardest to get right (and
I bet there are still bugs) because SIG die is still called within an eval.
But some evals are "OK" -- for example Apache::Registry scripts are
essentially the result of evaling.
Also, you don't appear to be catching croak, carp, and confess. It's not
necessarily obvious if you really want a full stack trace for all dies. It
usually makes sense for the programmer to choose the stack trace method.
These things are taken care of in CGI::Carp. However, with that said, I
think your code could make use of CGI::Carp and wrap around it with similar
effect.
As for sending email... You do know that there is a variable in CGI::Carp
where you can set up a reference to a subroutine instead of using Lincoln
Stein's right?
This can be set up to email instead of or in conjunction with printing to
the display.
Anyway, I do think the Apache side is useful, but I question rewriting the
logic of CGI::Carp when it looks like you could be making use of it as
either a subclass or a containment.
At 11:08 AM 11/30/00 -0500, Thomas J. Mather wrote:
>Sure. I have attached Apache/Carp.pm, so you can examine it.
>
>Some of the main differences that can't be implemented easily under CGI
>are:
>* Apache::Carp can be configured in the httpd.conf file to send an e-mail
>to the server admin by setting 'PerlSetVar APACHE_CARP_HANDLER
>email'. This way you can easily configure e-mail error notices on
>production servers and displayed error notices on development servers,
>_without_ changing Perl code base. This is very useful when you have
>production and development servers running off of the same CVS tree.
>
>* It displays the Apache handler that the error occurred under by using
>$r->current_callback
>
>Some other features that make it different from CGI::Carp include:
>* Can send e-mail notices - very useful for production servers.
>* Displays complete call stack even for warns and dies.
>* Displays user, host, remote_host, and referer (useful for email notices)
>
>On Thu, 30 Nov 2000, Gunther Birznieks wrote:
>
> > Can you help by explaining what this does that is different from
> CGI::Carp?
> > What are you doing that is Apache specific? Could CGI::Carp do the job? If
> > there was something you needed added to CGI::Carp, would it make sense for
> > you to add the apache-specific function flag to CGI::Carp instead of
> making
> > a brand-new module?
__________________________________________________
Gunther Birznieks ([EMAIL PROTECTED])
eXtropia - The Web Technology Company
http://www.extropia.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]