But, if your not outputting text/plain who cares about newlines in html, xml and the like?

Well, as an example, if the blank line was inside the quotes of an attribute, such as:

<a href="something.html ">
That would be bad. However, while this particular case I was converting HTML::Template to TT, where that is mostly not an issue, I was also thinking at the same time of using TT at work where we are generating shell scripts. Extra end-of-line characters can be catastrpohic there.

With plugins you can pull in the power of every perl module into your template.

No doubt you could. Moving the logic in there, however, gives me some eeby-jeebies. It's great if there's a single developer working on non-translated text. It gets a bit uglier if the file, with its code, gets to go out for translation, or if you have someone who knows code great, and another person who can design the heck out of a website. (I'm definitely not in the latter category - I'd love to get my wife doing the site design instead of me... and too much logic in there will just confuse her.) I get the power. I do. But something about it just makes me feel like it's a power that's drawing me to the "dark side" of intermixing logic and layout.


In reply to Re^2: Thoughts on converting from HTML::Template to Template Toolkit by Tanktalus
in thread Thoughts on converting from HTML::Template to Template Toolkit by Tanktalus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.