Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Re: Re: Re: There's a level in Hell reserved for ________

by demerphq (Chancellor)
on Mar 04, 2003 at 19:59 UTC ( #240430=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Re: There's a level in Hell reserved for ________
in thread There's a level in Hell reserved for ________

A couple of times I have embedded extremely simple templating code into projects I have worked on (usually for code generation purposes). Is this wrong in general in your view? My own justification was that it was simpler to write the 15~20 lines of code to handle what I wanted than it was to use one of the pre-existing modules out there. Just getting aquainted with the API of the module would have taken longer than writing the code.

To turn this into a question, assuming you need a no-frills, quick, light and easy templating system what would you use? A simple

$tags=join "|",map {quotemeta $_} keys %tags; 1 while s/\b($tags)\b/$tags{$1}/g;

or a templating module?


Replies are listed 'Best First'.
Re: Re: Re: Re: Re: There's a level in Hell reserved for ________
by perrin (Chancellor) on Mar 04, 2003 at 20:46 UTC
    I would use Text::Template. It is very simple, fast enough, handles all the typical templating bugaboos (escaping, for example), and provides plenty of room for growth before you will bump your head and need a different module.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://240430]
[Corion]: marto: Yep, but I didn't make it up north, sorry ;)
[Corion]: But LPW was enjoyable, even though it's always a bit hectic due to cramming everything into one day
[Corion]: I have no feeling about how my talk was received, but I'm happy with it, which counts the most to me ;-D
[Corion]: Also, London is always a nice visit, as I got to meet a friend there, and spent some time offline, working on "minor" features of the shadertoy thing ;)
[marto]: maybe next year when the kids are a little older I'll have time to attend perl events in Europe

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2016-12-07 09:25 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (125 votes). Check out past polls.