Please, do.

True, it is a common rite of passage. True, there are dozens available on CPAN, true, you should study those. Odds are you're not going to beat something like Text::Template

But false, writing your own is not a waste of time. It's a great way to focus on the issues involved in what a template system should do and on what you really want it to do.

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.

All, IMHO, of course.

scott

* Roughly, Fermi's Golden Rule #2 is a general expression for the transition rate of a quantum system, per unit time, from some initial state to some final state, where the situation is complicated enough to require being modeled as a perturbation of some more simple situation. Got all that? Pop quiz tomorrow. :)


In reply to Re: A quick and dirty template system by scott
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.