in reply to Re^2: Templating suggestions for code generation
in thread Templating suggestions for code generation

Oh, and I feel that I had to tweak it quite a bit just to get the proper amount of whitespace, adding the hyphens just at the right spots (those -%] thingies). Either I'm missing something, or Template::Toolkit could use a touchup.

You can control this behavior in a more global manner with the chomping options PRE_CHOMP and POST_CHOMP which you can set when you create your Template object. You can find some details on the TT web site in the section on config options.

  • Comment on Re^3: Templating suggestions for code generation

Replies are listed 'Best First'.
Re^4: Templating suggestions for code generation
by merlyn (Sage) on Feb 17, 2005 at 16:36 UTC
    I find in general that POST_CHOMP nearly always "does the right thing" for line-oriented output. I just have to remember the occasional "+" for those items that appear at the end of a line where I really do want to keep the newline.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.