SPUG: IIS 6.0 and Perl CGI

BenRifkah Burnett benb at speakeasy.net
Tue May 2 17:20:38 PDT 2006

Keith Reed wrote:
> We just moved from Apache to IIS 6.0, and all of our perl CGI programs 
> now display the following HTTP header line at the top of the document.
> Content-Type: text/html; charset=ISO-8859-1
If I understand this properly you're saying that your code is printing a 
header using $cgi->header AND you're also getting the above line in your 
output.  This means that you're getting two content-type HTTP headers in 
your output for cgi scripts.  Is this a correct assessment?

It's possible that your IIS setup is configured to automatically print a 
content-type header in certain circumstances.  I know nearly nothing 
about IIS so I can't help you go through your configuration to see if 
this is happening.  Post this question to an IIS group for that approach.

You may be able to troubleshoot this by creating a test perl script that 
doesn't use CGI.pm and see if you get the same results.  Try to simulate 
the environment of the script as much as possible.  Put it in the same 
directory that your other scripts are in.  Give it the same extension.  
Make sure it's the same file format (e.g.: UNIX, DOS).

You could try replacing one of your scripts with the following:

print "Content-Type text/html\n\n";
print "\n<br>Hello World";

If you still get two content-type headers then it's most likely an issue 
with IIS configuration and not with the way you're using perl.

-- BenRifkah Burnett,  Research Consultant
University of Washington
  * Biostatistics
    o Clinical Trials Center (CTC)
      + Resuscitation Outcomes Consortium (ROC)

More information about the spug-list mailing list