I may have complety missed the mark, but have you looked at the Text::Template module?
In particular, what your decribing made me think of the Philosophy section of Dominus' module.
Of the three templating modules I played with, the other two being HTML::Template, Template::Toolkit, it had the smallest learning curve and the (to my mind) greatest flexibility. Worth a look if you haven't already.
In reply to Re: Templating suggestions for code generation
by BrowserUk
in thread Templating suggestions for code generation
by bart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |