我正在使用以下代码来测试向浏览器输出致命错误:
use CGI;
use CGI::Carp qw(fatalsToBrowser);
die "test";
我希望在浏览器中看到一些错误,但没有任何错误,我只是得到一个常规的 500 响应。我忘记了我为远程请求打开了自定义错误页面,现在我得到了Script failed to send data.
.
还:
> perl -w index.pl
Status: 500
Content-type: text/html
<h1>Software error:</h1>
<pre>test at index.pl line 4.</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message and the time and date of the error.
</p>
[Mon Feb 8 18:29:52 2010] index.pl: test at index.pl line 4.