为什么我会得到一个“;“坏网关”;IIS上的Perl CGI程序出错?

为什么我会得到一个“;“坏网关”;IIS上的Perl CGI程序出错?,perl,iis,cgi,Perl,Iis,Cgi,我试图在Windows 7上运行示例Perl脚本,并将IIS 7配置为允许ActivePerl运行,但出现以下错误: HTTP Error 502.2 - Bad Gateway The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are "Hello World. ". Module CgiModule Noti

我试图在Windows 7上运行示例Perl脚本,并将IIS 7配置为允许ActivePerl运行,但出现以下错误:

HTTP Error 502.2 - Bad Gateway The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are "Hello World. ". Module CgiModule Notification ExecuteRequestHandler Handler Perl Script (PL) Error Code 0x00000000 Requested URL http://localhost:80/hello.pl Physical Path C:\inetpub\wwwroot\hello.pl Logon Method Anonymous Logon User Anonymous
任何CGI程序返回的第一个输出应该是头

试一试


然后将此链接放在手边,以备将来参考:
#!/usr/bin/perl
print "Hello World.\n";
#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "Hello World.\n";