Skip to content

Commit 0c45d62

Browse files
committed
CGI::Carp from CGI.pm 3.00 was missing.
p4raw-id: //depot/perl@20902
1 parent e994fd6 commit 0c45d62

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/CGI/Carp.pm

+9-3
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,13 @@ and the time and date of the error.
440440
END
441441
;
442442
my $mod_perl = exists $ENV{MOD_PERL};
443-
print STDOUT "Content-type: text/html\n\n"
444-
unless $mod_perl;
445443

446444
warningsToBrowser(1); # emit warnings before dying
447445

448446
if ($CUSTOM_MSG) {
449447
if (ref($CUSTOM_MSG) eq 'CODE') {
448+
print STDOUT "Content-type: text/html\n\n"
449+
unless $mod_perl;
450450
&$CUSTOM_MSG($msg); # nicer to perl 5.003 users
451451
return;
452452
} else {
@@ -490,7 +490,13 @@ END
490490
$r->custom_response(500,$mess);
491491
}
492492
} else {
493-
print STDOUT $mess;
493+
if (eval{tell STDOUT}) {
494+
print STDOUT $mess;
495+
}
496+
else {
497+
print STDOUT "Content-type: text/html\n\n";
498+
print STDOUT $mess;
499+
}
494500
}
495501
}
496502

0 commit comments

Comments
 (0)