So, anyway . . . I've got two near-identical Windows 2003 servers - live and test.

I have the same version of IIS (6.0) installed on both servers, but different versions of Perl.

On the live server, I have ActiveState 5.8.8. On the test server, I have Strawberry 5.12

I have the same script on both servers. The script begins like this:

use FindBin qw($Bin $Script); use lib "$FindBin::Bin/../lib"; use strict; use warnings; use Text::CSV; use CGI; use CGI::Session; use Net::LDAP; use DBI; use LWP::Simple;

I then define $session:

my $cgi = new CGI; my $session = new CGI::Session(undef, $cgi, {Directory=>'c:\temp'});

and I define the subroutine, output_header, to output the beginnings of a web-page:

sub output_header { my $current_session = $_[0]; my $wrb_url = $_[1]; # so what about the NPH thing?! print $current_session->header(-nph=>1); # print $current_session->header(); print <<ENDOFTEXT; <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html lang="en"> <head> ... [loads of HTML stuff goes here . . . ] ... ... </head> ENDOFTEXT }

I then call my subroutine:

output_header($session, $wrb_url);

Note: you can disregard $wrb_url - it's not important. The rest of the script works fine and just outputs the rest of a web-page, including the final </body> and </html> tags. In fact, the problems SEEM to start before the <head> tag, possibly something to do with the HTTP stuff sent right at the beginning. On the test server, the browser returns CGI Error, with the line under that reading: 'The specified CGI application misbehaved by not returning a complete set of HTTP headers.'. The live server works fine. The only difference I've been able to spot in the HTTP is the inclusion of the following line on the live server:

Cookie: CGISESSID=52308b820ff99fd3d4dca46c4b7a5280

[obviously the value of CGISESSID changes] This line is absent in the HTTP from the test server. I've been tearing my hair out trying to work out what on earth is wrong and why I'm getting that CGI error. Anyone?


In reply to Strawberry Perl and IIS not playing by bunchily

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.