I am having a strange problem, maybe something to do with Apache more than Perl. In my code when I write:
print "content-type: text/html\n\n";
it prints that along with the code. But when I type:
$c = new CGI; $c->header();
it works fine and displays the HTML rendered output.
What could the problem be?
Thank you
Keep in mind, HTTP RFC specifies that
is used for line delimiters, not
so you want to be emitting
Instead.
You should just use
->headersthough to do this for you.Also, note I used Camel-Case instead of lower-case. Although both should work, the Camel-Case is the notation used in the spec, so that is preferred and more likely to work on weird UA’s.