[H-GEN] CGI Troubles.
Clinton Roy
croy at dstc.edu.au
Mon May 14 19:52:47 EDT 2001
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Please observe the list's charter. ]
[ Worthwhile understanding: http://www.humbug.org.au/netiquette.html ]
Conor Cunningham <cunningham at uq.net.au> writes:
assuming that the rest of the Perl is correct:
> print "Content-type:text/html\n\n";
As Jason pointed out, there should be a space after the colon, to
conform to `common form', although any amount of white space is
compliant (including none). The header should end with a "\r\n" and
the end of headers is signalled by an empty header, another
"\r\n". So, if your client was fully compliant with 2068, it would
accept this response, but it's not a valid response, so it can barf :)
(I have a feeling it's apache that is complaining about the http
response, but that's kinda irrelevant.)
So, (assuming that Perl doesn't add newlines when it prints, like
Python does), I'd expect something like the following to work:
#! /usr/bin/perl
print "Content-type: text/plain\r\n";
print "\r\n";
print "foo";
Untested.
hth.
--
Clinton Roy
I speak for me and myself, but not my shadow.
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.
More information about the General
mailing list