次のコードを使用して、ブラウザへの致命的なエラーの出力をテストしています。
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.