in reply to Mapping Logic
Did you notice the "Miscelaneous Options" section in the HTML::Template POD? If you set loop_context_vars => 1 when you create the HTML::Parser instance, you'll get a couple of magic variables that you can use inside of <TMPL_LOOP> for doing odd/even stuff. It lets you write
Depending on what you're doing, handling odd/even in the template can be a lot cleaner than trying to do it in code.<TMPL_LOOP stuff> <TMPL_IF NAME="__ODD__"> Odd stuff <TMPL_ELSE> Even stuff. </TMPL_IF> </TMPL_LOOP>
|
|---|