views:

59

answers:

1

I am working on a project where I am generating some code/scripts (specifically Perl scripts) via Java and Freemarker. I have it working for now, but was wondering if there was some way to change the default variable delimiter ($) in Freemarker?

Or is there a different Java template engine that would use a variable delimiter more suitable for generating a Perl script?

A: 

The variable delimiter is not $foo, it is ${foo}.

I don't know perl, but to generate something with $ you do :

$${foo} -> $FOO

<#noparse>${</#noparse>${foo}} -> ${FOO}

Very cool :-)

I think best way is to make macro to put perl things in your interpolations, like escape/noescape directive.

Istao
Please learn to edit markdown: http://stackoverflow.com/editing-help
daxim
This isn't exactly what I was looking for. I want to use a completely different delimiter than "$" for Freemarker. Not sure it's possible. What you have there is true and nice, but not exactly what I need.
JamesD
OK. If you decid to go on with freemarker, post your question on user mailing list. This list is very reactive and the persons are very interesting.
Istao