Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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]
and all is calm...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2018-01-18 21:53 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (215 votes). Check out past polls.