Given your cite, I stand corrected on my statement re the DOCTYPE being optional; I can't even recall which 'authority' put that notion in my head.

However, I would continue to hold that the <head>...</head> is required (*1 qualifier below) because <title>...</title> is required and §7.4 of w3c's html 4 documentation says:

"Every HTML document must have a TITLE element in the HEAD section." (emphasis in the original at 7.4.3)

*1 And yes, that directly contradicts the w3c cite you provided ...suggesting that:

  1. w3c needs to get its act together
    or
  2. I'm mis-reading something, or failing to distinguish properly between its "normative" and "informative" documentation.

So, while I'm uncertain which citation governs here, I think each of us has an arguably sound basis for our assertions (at least re <head>...<head>).

Moving on to into calculations of how many angels can dance on the head of a pin...

§7.3, "The HTML element," appears to me to be directive and thus to offer some support for my notion that the <html ...> is required:

"After document type declaration, the remainder of an HTML document is contained by the HTML element."

But, I must also concede that the quote above does not quite offer explicit contradiction of the earlier indication that the <html> element is optional... and I cannot re-find the (vividly/spuriously?) remembered 'authority' which -- as I recall it -- asserted that tags like <p>, <h#>, <ol>, <table>, <div> and company can appear only inside a <body>...</body> pair.

That said, I belatedly noticed (and only after your msg re the doubled <!DOCTYPE> for which, thanks!) that CGI.pm produced an XHTML <!DOCTYPE>, making the example pretty much irrelevant to the thrust of my comment ((or irrelevant, confusing and stupid: ie, I forgot to include -no_xhtml in the use CGI line).


In reply to Re^3: Arrays with CGI perl help (More fundamental issues) by ww
in thread Arrays with CGI perl help by perlnewb123

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.