The q// and qq// quoting operators and here docs can make it very easy to visually separate your HTML from your Perl code. But why not go all the way and really separate your HTML and your Perl?

Unless your site is rather small and will stay that way, you really, really want to use templates. I know, I learned the hard way.

When you decide to use a templating system, don't roll your own, use one of the many excellent modules on CPAN. I know, I learned the hard way.

Which templating system to use? Either start with something simple like HTML::Template or Text::Template and when you are ready for more you can transistion to something more powerful like HTML::Mason or Template Toolkit. Or you could dive right in and learn one of the more powerful systems now.

By the way, you really do want to use strict, use CGI, and enable warnings and taint checking. The sooner you start using these tools, the happier you will be. Check out Ovid's CGI tutorial, you will be glad you did.


TGI says moo


In reply to Re: Images by TGI
in thread Images 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.