|Syntactic Confectionery Delight|
An Idea for a New Template Toolkit Improvement(?)by monsieur_champs (Curate)
|on Mar 30, 2004 at 19:58 UTC||Need Help??|
monsieur_champs has asked for the
wisdom of the Perl Monks concerning the following question:
First, I need to make it clear that I'm not sure that this is really usefull, or the Best Way To Do It(tm). So, before you pass trough, please take a minute and think about the problem. Maybe you know a way of doing this that I don't.
I'm building need to build context-driven custom messages for some situations in my system. I'm using Andy Wardley's Template::Toolkit for building the Templates and need to figure out a way to read meta-information from the template, so I can for example do something like this:
Update: Added a little more consistent example code.
In other words, I need an idea for a mechanism that can associate a piece of perl code (in string format) that can be eval()'ed to get the actual value for each variable needed by a template.
Do the Perl Monks have any suggestions of ways of doing this "magic"?
Thank you all in advance for your precious ideas and time!