tags:

views:

283

answers:

1

I'm trying to run sample Perl script on Windows 7 and I configured IIS 7 to allow ActivePerl to run but I'm getting this error:

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

and here is my Perl script:

#!/usr/bin/perl
print "Hello World.\n";
+4  A: 

The first output returned from any CGI program should be the headers.

Try

#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "Hello World.\n";
mobrule
And then keep this link handy for future reference: http://stackoverflow.com/questions/2165022/how-can-i-troubleshoot-my-perl-cgi-script
mobrule
Thank you so much it is working now.
Eyla