Which part of
Not only do you have the usual flaws of embedding the html(presentation) in your code(control), you don't even make the html in an easily recognizable form.
Did you not understand? I present two clear criticisms. One is that embedding the html generation in the code is usually a bad idea REGARDLESS OF THE APPLICATION. The second is that the embedded form of the code is extremely ugly when you use CGI.pm. Using CGI.pm to produce html leads to complicated overdone code that is hard to read and understand.

And yes, templates are good, but I'd much rather see the person just use prints statements to output the html, rather than the horrible functions exported by CGI.pm.

Update Just a node responding to both replies: Nothing I have said precluded the possibility of keeping the script as one file. Any sane templating system (HTML::Template, just for example) will let you embed the template *in* the same file as your script is, for example below the __DATA__ line, or even just as a giant quoted string.

In reply to Re^2: image and href tags in CGI.pm by BUU
in thread image and href tags in CGI.pm by Anonymous Monk

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.