http://qs321.pair.com?node_id=338967


in reply to Re: Re: Templating system for generating C code?
in thread Templating system for generating C code?

Here documents work well if all you have to do is replacing some variables. If you need more, especially conditions and loops, then the handling with here documents becomes ugly --- you may embed simpler conditions as @{[ $condition ? $foo : $bar ]}, but often you have to split the here doc into multiple parts.

Regarding keeping the logic outside: most, if not all templating systems work by receiving their data from the outside and doing only the output work. Some templating systems additionaly have more features (up to a [% PERL %] directive to embed perl code), but it's up to you to use them or not.