You seem to think that templates are just about replacing variables.

There are more techniques like "includes", were sub-templates are integrated which have sub-templates and so on.

Or embedding programming code inside the HTML for loops or conditional snippets.

And there is reusability, like hacking once a generic "table" template and applying it to different projects.

I have to admit all of this can also be done with pure Perl and no regexing at all, thanks to it's flexibility.

But a framework has a lot of benefits in a team, for instance I don't have teach my colleagues a bunch of best practices if there is already a well documented trail to do it.

Separated HTML-code is not only easier to edit - if it's well done the browser can display it , my editor can highlight it properly and formatting, validation and indentation is easy.

Last but not least, isolated HTML code can be handled by a web specialist without any knowledge of the controlling programming langue, much like SQL-Statements don't need expertise in Perl. That's the main idea of the MVC pattern.

Example from another perspective ... You've spend much time criticizing the design of the monastery, but it's a monolithic framework in pure Perl written 20 years ago.

We can't simply ask several design expert to overhaul the templates, because a lot of HTML is interspersed inside Perl code. (actually it's even much more complicated, because many people added parts in the past)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery


In reply to Re^5: Here documents in blocks (why templates) by LanX
in thread Here documents in blocks by Bod

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.