At 06:38 PM 4/19/00 -0700, Perrin Harkins wrote:

> > > CGI::Carp can't catch compile errors.
> >
> > Oh.  The CGI::Carp manpage says (regarding the use of "set_message()" to
> > control the output message): "In order to correctly intercept compile-time
> > errors, you should call set_message() from within a BEGIN{} block. ", which
> > suggests it does catch compile errors?  I've tried both with "BEGIN
> > {set_message('...')}" and without a set_message() at all, but to no avail.
>
>My mistake.  CGI::Carp doesn't catch compile errors inside an eval block,
>which is where you are when compiling under Apache::Registry.  You could
>work around this by commenting out the first line of the die() subroutine
>where it checks to see if it's in an eval, but that's pretty lame and
>makes CGI::Carp incompatible with use of eval blocks.  I don't use
>Apache::Registry or CGI::Carp, so I'm not very motivated to find a better
>fix.  You could contact the author.

Actually I do not believe that this will help anyway. The reason being that 
when you compile code in an eval, it is not a die error in the first place. 
It ends up being a warning (so you need to trap the WARN signal).

To do this, Apache::Registry itself would need to be the one catching the 
compilation error in a WARN signal and then outputting something to the 
browser.

I don't know of a real way around this. However, I did spend some time 
investigating these issues today and will post some of my results to 
previous messages.


__________________________________________________
Gunther Birznieks ([EMAIL PROTECTED])
Extropia - The Web Technology Company
http://www.extropia.com/

Reply via email to