in reply to CGI Carp

What version did you have before you upgraded?

Have you checked the changelog?
http://search.cpan.org/author/LDS/CGI.pm-2.89/CGI/Carp.pm
http://search.cpan.org/src/LDS/CGI.pm-2.89/cgi_docs.html

use CGI::Carp qw(fatalsToBrowser set_message); BEGIN { sub handle_errors { my $msg = shift; print "<h1>Oh gosh</h1>"; print "<p>Got an error: $msg</p>"; } set_message(\&handle_errors); } In order to correctly intercept compile-time errors, you should call s +et_message() from within a BEGIN{} block.
I vaguely, vaguely, vaguely recall this working a long time ago, but it doesn't appear to be currently ;)(time for a bug report i'd say)


MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
** The Third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: CGI Carp
by Anonymous Monk on Feb 07, 2003 at 15:22 UTC
    Previous CGI.pm version was 2.56, now it is 2.89. But I don't want to modify *all* my scripts to make compile errors appear by adding a set_message! i want to change just one thing (in CGI.pm for example)... Gosh i hate this 'Server Error'! PS: i'm parsing the changelog... Thanks!
Re: Re: CGI Carp
by Anonymous Monk on Feb 07, 2003 at 15:48 UTC
    Apparently, the code you pointed out (calling set_message) doesn't catch syntax and compile-time errors... Still, it seems CGI::Carp doesnt print the Content-type header...