Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Template Question

by stefan k (Curate)
on Dec 12, 2002 at 11:30 UTC ( #219285=note: print w/replies, xml ) Need Help??


in reply to Template Question

Hi,
I use to keep my variables on a hash and then use a very similar approach as abell (assuming that the variables are written in a Makefile-like style: $(variablename):
foreach (keys %global_variables) { $content =~ s/\$\($_\)/$global_variables{$_}/g; }
but with this code it is not possible to escape the variable name expansion (e.g. by putting a \) in front of the $. Since there are probably some pitfalls around it would be wise to use an exisiting templating system (btw: is there any reason that so many templating systems exist? ;-)

Regards... Stefan
you begin bashing the string with a +42 regexp of confusion

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://219285]
help
Chatterbox?
[marioroy]: Corion Regarding PID, that's great. So will leave it so compatible with MCE::Hobo. e.g. ->create returns a Hobo object. Folks can get ->pid from it. So, that's not a problem.
[choroba]: ad readdir: 5.12 needed
[marioroy]: CORE::wait can block if another process reaps a worker from another class. MCE::Hobo takes care of that and transparently.
[Discipulus]: thanks choroba i'll update my answer
[Lady_Aleena]: Hello Discipulus, Corion, choroba, and marioroy...
[Corion]: Hi Lady_Aleena!
[Lady_Aleena]: marioroy, are you also writing a Meditation for this?
choroba o/
Discipulus adds tozzetti alle mandorle to the platter on the sideboard.
Lady_Aleena was checking #cbstream and saw the big announcement.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2017-05-26 08:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?