in reply to A quick and dirty template system

Please. Don't.

I don't know why it's some "rite of passage", but it seems that everyone goes out and (re)writes their own templating system in Perl.

There are already something like 36(!) of them in the CPAN.

Please study them first. If none of them do what you want, feel free to write your own, or better, contribute code patches to the one that is closest to what you want.

The world does not need you wasting your time reinventing this wheel for the 37th time. There are many more urgent things to do. If you're really looking for something to tackle in your spare time, ask me... I've got a pile of stuff on my todo list.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: A quick and dirty template system
by George_Sherston (Vicar) on Sep 13, 2001 at 18:04 UTC
    There are already something like 36(!) of them in the CPAN.

    Perhaps that's got something to do with why everyone wants to write his own. I certainly thought of it (and then thought better). Because if there are 36 to choose from (A) it opens up the hope of getting a perfect template, which is in fact a doomed hope unless one writes one's own; (B) why should I think mine won't be as good as number 30 at least? (C) how the devil do I choose one of them - and by the time I've assessed all thirty-six I could have written my own.

    My point is, I would be very glad to hear of any other monk's experience with one or more of the different systems, particularly if capable of comparing one with another. That way my choice of one out of thirty-six would be a little less random...

    § George Sherston
Re: Re: A quick and dirty template system
by rrwo (Friar) on Sep 13, 2001 at 12:41 UTC

    Don't worry. This is just a quick hack. Literally a couple of lines of code.

    I'm not about to implement a new template system, though if it seems unique enough and can remain simple, well, it might grow into something in the distant future...

Re: Re: A quick and dirty template system
by sierrathedog04 (Hermit) on Sep 30, 2001 at 06:38 UTC
    Yet I can think of one very good reason why I might prefer a simple templating sub like this one to the more advanced modules on CPAN.

    My ISP lets me run Perl scripts but does not allow me to install modules. To install one of the CPAN modules I would need to:

    1. find one that did not have C code in it
    2. then experiment with creating the proper subdirectories so the various module components could all locate each other at runtime.

    Isn't it better to run a simple script like this that does what I want? Indeed, I intend to try this one out.

    I truly believe that Merlyn is brilliant. I read his columns. I buy his books. I vote for his nodes on this site.

    But we are not all Merlyn. I am running on an inexpensive web server that only has limited capabilities. CPAN modules are out of my league at home, although I use them at work every day.