I don't think there is any substitute for learning by doing. Studying the derivation of Fermi's Golden Rule #2* is, speaking from direct experience, far less enlightening than closing the book and deriving it starting from a blank sheet of paper.
And part of learning is studying prior art, which is apparently lacking in practically all of the "templating systems" I've seen.

Listen, I really wouldn't mind someone saying "I've studied Template, and Text::Template and HTML::Template and Text::MetaText and the PerlFAQ entries and ..., and now I want to write my own, because this feature is lacking and that feature is broken". But nobody has ever done that that posts "here's my templating system, and it's simple for now, but I'm adding $FEATURE_X later". They just go off and start implementing. You think Perl would have been where it is had Larry not carefully studied Awk and Sed and other tools before he started?

This is why I grumble about reinvention, and templating systems in particular. Do not attempt to reinvent the wheel without studying the fallacies of those who have gone ahead, or else you are wasting human potential in a larger sense. This isn't just about you. It's about humanity.

-- Randal L. Schwartz, Perl hacker


In reply to Re: Re: A quick and dirty template system by merlyn
in thread A quick and dirty template system by rrwo

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.