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


in reply to Templating suggestions for code generation

Nothing wrong with the other suggestions, but HTML::Template can do something similar:

//START <tmpl_loop name="cases"> <tmpl_if name="__first__"> switch(x) { </tmpl_if> case <tmpl_var name="case": // <tmpl_var name="case_code"> <tmpl_unless NAME="__last__"> break; <tmpl_else> } </tmpl_unless> //END

Loops have __first__, __last__, __inner__, __odd__ and __counter__.