From: Jarkko Hietaniemi Date: Tue, 26 Aug 2003 08:36:36 +0000 (+0000) Subject: CGI::Carp from CGI.pm 3.00 was missing. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0c45d622c9a2e592a5401e1add3c9e8a9170179a;p=p5sagit%2Fp5-mst-13.2.git CGI::Carp from CGI.pm 3.00 was missing. p4raw-id: //depot/perl@20902 --- diff --git a/lib/CGI/Carp.pm b/lib/CGI/Carp.pm index 8420eb2..b990041 100644 --- a/lib/CGI/Carp.pm +++ b/lib/CGI/Carp.pm @@ -440,13 +440,13 @@ and the time and date of the error. END ; my $mod_perl = exists $ENV{MOD_PERL}; - print STDOUT "Content-type: text/html\n\n" - unless $mod_perl; warningsToBrowser(1); # emit warnings before dying if ($CUSTOM_MSG) { if (ref($CUSTOM_MSG) eq 'CODE') { + print STDOUT "Content-type: text/html\n\n" + unless $mod_perl; &$CUSTOM_MSG($msg); # nicer to perl 5.003 users return; } else { @@ -490,7 +490,13 @@ END $r->custom_response(500,$mess); } } else { - print STDOUT $mess; + if (eval{tell STDOUT}) { + print STDOUT $mess; + } + else { + print STDOUT "Content-type: text/html\n\n"; + print STDOUT $mess; + } } }