in reply to HTML::TreeBuilder bug or feature?

From the HTML::TreeBuilder man page:
  $root->store_declarations(value)
      This determines whether TreeBuilder will normally
      store markup declarations found while parsing content
      into $root.  Currently, this is off by default.

      It is somewhat of a known bug (to be fixed one of 
      these days, if anyone needs it?) that declarations in 
      the preamble (before the "html" start-tag) end up
      actually under the "html" element.
So that makes it a bug.
-- gam3
A picture is worth a thousand words, but takes 200K.