I am a one-person team, doing both the design and coding for my company's Intra- and Inter- nets. I started out using HERE documents within my cgi scripts. I like the convenience of having everything contained in a single program, and since I don't have anyone else involved it's worked out ok.

However, things change, and the 2 sites are getting larger and perhaps someday I'll have help. I'm currently re-building our Intranet site and since I'm touching everything anyway, I decided to convert some of my old code to HTML Templates.

Initially, I was frustrated with my efforts. While there is documentation available, most of it struck me as being less than instructive. The examples seemed simplistic and not in-depth. I think most of it was written from the perspective of coding, not combining code and design. I persisted though, and now I think I was trying to make things way too complicated.

I did a super search and found an HTML::Template Tutorial and another node on Loop Context Style with HTML::Template. Things seem to have clicked into place and I think I'm on my way to becoming an HTML::Template convert. I made progress today and converted 2 scripts in short order. It gets easier from here. While I can still see good reasons for keeping everything tidy in one script, I can now see other good reasons for pulling it all apart. I think it all depends on what your needs are. I do recommend learning to use Templates, though, as it just adds another option to your toolchest.


In reply to Re: HTML In CGI Scripts. by WhiteBird
in thread HTML In CGI Scripts. by elam

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.