Here is a program I threw together after surfing the Internet.
#!/usr/bin/perl # html_indenting2.pl perl html_indenting2.pl HTML indenting wit +h Perl. # From http://stackoverflow.com/questions/8225194/html-indenting-with- +perl best answer use strict; use warnings; use HTML::HTML5::Parser qw(); use HTML::HTML5::Writer qw(); use XML::LibXML::PrettyPrint qw(); print HTML::HTML5::Writer->new( start_tags => 'force', end_tags => 'force', )->document( XML::LibXML::PrettyPrint->new_for_html( indent_string => "\t" )->pretty_print( HTML::HTML5::Parser->new->parse_string( q[<meta content="J K Rolling" name="Author" /> <meta content="Harry Potter and the Philosopher's Stone" name="title" +/> ] ) ) ); # This prints: # <!DOCTYPE html><html> # <head> # <meta content="J K Rolling" name=Author> # <meta content="Harry Potter and the Philosopher's St +one" name=title> # </head> # <body></body> # </html> __END__
The order of the meta content is the way you want it.

In reply to Re: Ordering meta tags with HTML::Element by Cow1337killr
in thread Ordering meta tags with HTML::Element by HeadScratcher

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.