2
0

README 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Text::Template v1.46
  2. This is a library for generating form letters, building HTML pages, or
  3. filling in templates generally. A `template' is a piece of text that
  4. has little Perl programs embedded in it here and there. When you
  5. `fill in' a template, you evaluate the little programs and replace
  6. them with their values.
  7. Here's an example of a template:
  8. Dear {$title} {$lastname},
  9. It has come to our attention that you are delinquent in your
  10. {$monthname[$last_paid_month]} payment. Please remit
  11. ${sprintf("%.2f", $amount)} immediately, or your patellae may
  12. be needlessly endangered.
  13. Love,
  14. Mark "{nickname(rand 20)}" Dominus
  15. The result of filling in this template is a string, which might look
  16. something like this:
  17. Dear Mr. Gates,
  18. It has come to our attention that you are delinquent in your
  19. February payment. Please remit
  20. $392.12 immediately, or your patellae may
  21. be needlessly endangered.
  22. Love,
  23. Mark "Vizopteryx" Dominus
  24. You can store a template in a file outside your program. People can
  25. modify the template without modifying the program. You can separate
  26. the formatting details from the main code, and put the formatting
  27. parts of the program into the template. That prevents code bloat and
  28. encourages functional separation.
  29. You can fill in the template in a `Safe' compartment. This means that
  30. if you don't trust the person who wrote the code in the template, you
  31. won't have to worry that they are tampering with your program when you
  32. execute it.
  33. ----------------------------------------------------------------
  34. Text::Template was originally released some time in late 1995 or early
  35. 1996. After three years of study and investigation, I rewrote it from
  36. scratch in January 1999. The new version, 1.0, was much faster,
  37. delivered better functionality and was almost 100% backward-compatible
  38. with the previous beta versions.
  39. I have added a number of useful features and conveniences since the
  40. 1.0 release, while still retaining backward compatibility. With one
  41. merely cosmetic change, the current version of Text::Template passes
  42. the test suite that the old beta versions passed.