Am trying to generate some HTML using HTML::Tiny, which has been a good resource, up until now! I want to create an HTML5 tag of audio, such as:

<audio controls> src = "file.mp3", type = "audio/mpeg" </audio>
using the perl code:
$co->tag ('audio', { controls=>[], type => "audio\/mpeg", src => "$fil +ename.".mp3"})
which produces this output:
<audio controls="controls" src="theme1.mp3" type="audio/mpeg"></audio>
In the HTML::Tiny documentation, it states (from the CPAN depository)
An empty attribute - such as 'checked' in a checkbox can be encoded by + passing an empty array reference: print $h->closed( 'input', { type => 'checkbox', checked => [] } ); would print <input checked type="checkbox" />
so what I want is an empty attribute for my "controls" part of the audio tag, which is obviously what is not happening. Any guidance? regards ADB

In reply to HTML::Tiny, null parameter tags contradicting documentation by gsd4me

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.