On Tue, 09 May 2006, dorian wrote:
This problem is due to a bug fix in PerlIS that appeared in build 815
and later. Unfortunately it doesn't seem to have gotten recorded
in the changelog entries for the release.
PerlIS will automatically generate CGI headers unless it detects that
the headers are already there. However, it only detects headers if the
CGI output starts with "HTTP/" or "Status:" as the very first
characters.
If a header is not detected, PerlIS will generate its own header
block. The bug in older PerlIS versions was that it did not add the
second "\r\n" sequence that separates the header block from the
content of the page. So any additional headers printed by the CGI
script would just be appended to the PerlIS generated header, and
things looked (mostly) well.
This also means that PerlIS *always* treated the first paragraph of text
as part of the header.
Since CGI.pm doesn't generate "full" headers, PerlIS doesn't detect them
properly and will always generate its own header block followed by "\r\n\r\n".
So any additional header lines will now become part of the content.
A workaround is to tell CGI to generate "non parsed headers":
use CGI qw/:standard :nph/;
This will generate a full header block starting with "HTTP/1.0 200 OK",
which will be properly detected by PerlIS and no additional headers will
be generated.
I'll see if we can improve the heuristics to better detect a correctly
formed header block automatically, but that will obviously not happen
until we have another ActivePerl release.
Cheers,
-Jan
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs