Joe McMahon writes ..
>On Wed, 2 May 2001, J. Patrick Lanigan wrote:
>
>> I am getting an "Internal Server Error" returned to my
>browser. The error
>> log shows the following:
>>
>> "[Wed May 2 00:04:39 2001] [error] [client 192.168.0.10]
>Premature end of
>> script headers: /path/to/filename"
>>
>> I have set the directory and file to 755 and the correct
>ownership. I have
>> tried a couple simple scripts and gotten the same error:
>>
>> _First_Script_
>>
>> #!/usr/bin/perl
>> print "Content-type: text/html\n\n";
>
>You're going to think I'm mad, but try this instead:
> print "Content-type: text/html\n\r\n\r";
you almost certainly meant \r\n (CRLF) which is the network standard
line-ending sequence .. I don't think LFCR is used anywhere
that having been said - you should also binmode your STDOUT to prevent some
systems from munging that "\n" into a "\r\n"
>Why is that? Different platforms have different characters which they
>consider to be a line end.
that's not the issue - the issue is that by using a plain LF you're relying
on the socket library on the server that this script is running on to
convert that to CRLF for you - which most do .. but not all
because network protocols demand CRLF
--
jason king
In Norway, you may not spay your female dog or cat. However, you may
neuter the males of the species. - http://dumblaws.com/