BTW, this is one of the main reasons why I encourage the use of CGI.pm for producing HTML output (not just for interpretting CGI parameters). Just in the code for PerlMonks, quite a large number of bugs can be blamed on not using CGI.pm (I've seen many introduced when code was converted to not use CGI.pm, I've seen many fixed when code was converted to use CGI.pm, and there are at least a few still present that I hope to fix by using CGI.pm).

Not that CGI.pm's generation of HTML is perfect. Having radio_group() call escapeHTML() on the labels is simply a mistake and I'm not a big fan of what end_form() does. And the most common mistake I see made is people not specifying force=>1 when they should.

But I suspect that you've only noticed this bug in one place and that you likely have the same bug in several other places. And knowing how to escape a value in some parts of HTML can be rather tricky. But the biggest problem appears to me to be that people simply don't think about having to escape values and just include them unchanged into their HTML and that often works (and sometimes you should not escape things). So I consider generating HTML with CGI.pm to be a good habit (in situations where a better habit isn't being used).

                - tye

In reply to Re: HTML Problem getting entities into a textarea (CGI.pm) by tye
in thread HTML Problem getting entities into a textarea by muad33b

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.