Get Down, Ye Monks!

This might be a stupid question, so any thrown fruit is accepted as due. I've poked around the docs and supersearch, but I don't really know how to phrase the question in a way a search engine can parse...

I'm considering using Template Toollkit for a project. TT seems to require that the templates etc.. come from external files. I just want to process strings. Am I missing something obvious, or is this actually a pretty complex request for TT?

Here's the background: I'm a sysadmin and I've got a zillion little helper scripts that make accounts of various kinds, change quotas, delete things etc... I've finally decided to factor out the common tasks into a module. One of the things I keep writing over and over again is an email to the user in question. These emails are usually %80 identical. I'd like to use TT to make a readily extensible email template. I'd rather keep the template data in the module, rather than spreading out over multiple files because I really don't want these things to get out of sync and I think that'd be easier overall.

UPDATE:

I just stood up, fed the cats, and remembered the real reason I don't want to use external files: when I use this module inside a script, I'd like to be able to manipulate the email from within those scripts without another text file to worry about. My brain is not having a good day. Be merciful...

Thanks!
--Pileofrogs


In reply to TT & templates from data? by pileofrogs

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.