perl 出错信息
刚开始接触PERL,不怎么熟悉语法,经常出错,不过出错信息实在太不友好了
#!O:/php/perl/bin/Perl.exe
print "Content-type:text/html\n\n";
print "<center><h2>Hello World</h2></center>;
#这里少了一个“ 号
exit; www.shengfang.org
Internal Server Error www.shengfang.org
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, www.shengfang.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/2.0.54 (Win32) PHP/4.3.10 Server at 127.0.0.1 Port 80
这根本都看不出什么东西 www.shengfang.org
找了一些资料,原来这样就可以了
加入: www.shengfang.org
use CGI::Carp qw(fatalsToBrowser);
Software error:
syntax error at O:/php/Apache Group/Apache2/cgi-bin/sf.pl line 8, near "print "Content"
syntax error at O:/php/Apache Group/Apache2/cgi-bin/sf.pl line 8, near "gb2312\"
Can't find string terminator '"' anywhere before EOF at O:/php/Apache Group/Apache2/cgi-bin/sf.pl line 26.
For help, please send mail to the webmaster (www.shengfang.org), giving this error message and the time and date of the error.
B<CGI::Carp> - CGI routines for writing to the HTTPD error log
CGI::Carp - CGI routines for writing to the HTTPD (or other) error log
--------------------------------------------------------------------------------
SYNOPSIS
use CGI::Carp;
croak "We're outta here!";
confess "It was my fault: $!";
carp "It was your fault!";
warn "I'm confused";
die "I'm dying.\n";
use CGI::Carp qw(cluck);
cluck "I wouldn't do that if I were you";
use CGI::Carp qw(fatalsToBrowser);
die "Fatal error messages are now sent to browser";
--------------------------------------------------------------------------------
DESCRIPTION
CGI scripts have a nasty habit of leaving warning messages in the error logs that are neither time stamped nor fully identified. Tracking down the script that caused the error is a pain. This fixes that. Replace the usual
use Carp;
with
use CGI::Carp
And the standard warn(), die (), croak(), confess() and carp() calls will automagically be replaced with functions that write out nicely time-stamped messages to the HTTP server error log.
For example:
[Fri Nov 17 21:40:43 1995] test.pl: I'm confused at test.pl line 3.
[Fri Nov 17 21:40:43 1995] test.pl: Got an error message: Permission denied.
[Fri Nov 17 21:40:43 1995] test.pl: I'm dying.
AUTHORS
Copyright 1995-2002, Lincoln D. Stein. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Address bug reports and comments to: lstein at cshl dot org