I don't know whether this matters, but http defines the header as "Content-Type:"

It doesn't. Section 4.2, "Message Headers" of rfc2616 states:

Field names are case-insensitive.

Although the RFC is mostly consistent in its use of "Content-Type", there is an example under Section 19.2, "Internet Media Type multipart/byteranges" where the capitalization "Content-type" is used three times.

My own use of that capitalization is a habit. I can trace it back to the examples in the first printing of "the mouse" which was my primary reference when I started writing CGI scripts. That was Way Back When[tm] it was still CGI Programming on the World Wide Web rather than CGI Programming with Perl, authorship wasn't shared, and cgi-lib.pl was still preferred for two reasons: Lincoln hadn't turned his buggy CGI::* modules into a coherent and stable CGI.pm yet and a lot of us were still using perl4.

As if this answer wasn't long enough, I had a look at the CGI 1.1 Specification draft Revision 03 (expired) too. It uses both capitalizations as well. The BNF seems to indicate that the script is to return a "Content-type" field.

This answer is long enough now that I might as well turn it into a soap box (for completeness if nothing else.) So, if you think an RFC specifying CGI makes sense, ping Ken Coar about it. The effort pretty much came to a halt after revision 3 of the draft. I did get a response from Ken on the CGI-WG list in early June though, so there might still be hope.

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Re: Premature end of script by sauoq
in thread Premature end of script by Baz

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.