• Stars
    star
    13
  • Rank 1,482,894 (Top 30 %)
  • Language
    Perl
  • Created over 7 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Expand template text with embedded Perl
Text::Template

This is a library for generating form letters, building HTML pages, or
filling in templates generally.  A `template' is a piece of text that
has little Perl programs embedded in it here and there.  When you
`fill in' a template, you evaluate the little programs and replace
them with their values.  

Here's an example of a template:

	Dear {$title} {$lastname},

	It has come to our attention that you are delinquent in your
	{$monthname[$last_paid_month]} payment.  Please remit
	${sprintf("%.2f", $amount)} immediately, or your patellae may
	be needlessly endangered.

			Love,

			Mark "{nickname(rand 20)}" Dominus


The result of filling in this template is a string, which might look
something like this:

	Dear Mr. Gates,

	It has come to our attention that you are delinquent in your
	February payment.  Please remit
	$392.12 immediately, or your patellae may
	be needlessly endangered.


			Love,

			Mark "Vizopteryx" Dominus

You can store a template in a file outside your program.  People can
modify the template without modifying the program.  You can separate
the formatting details from the main code, and put the formatting
parts of the program into the template.  That prevents code bloat and
encourages functional separation.

You can fill in the template in a `Safe' compartment.  This means that
if you don't trust the person who wrote the code in the template, you
won't have to worry that they are tampering with your program when you
execute it.  

----------------------------------------------------------------

Text::Template was originally released some time in late 1995 or early
1996.  After three years of study and investigation, I rewrote it from
scratch in January 1999.  The new version, 1.0, was much faster,
delivered better functionality and was almost 100% backward-compatible
with the previous beta versions.

I have added a number of useful features and conveniences since the
1.0 release, while still retaining backward compatibility.  With one
merely cosmetic change, the current version of Text::Template passes
the test suite that the old beta versions passed.

More Repositories

1

number-phone-countrycode

Country specific dialing prefixes for phone numbers
Perl
5
star
2

toggl-invoicer

A "Contractor Style" monthly invoice generator for Toggl
TeX
5
star
3

apache-singleton

singleton class for mod_perl / mod_perl2
Perl
4
star
4

apache-authticket

mod_perl AuthCookie based authentication and access module
Perl 6
3
star
5

apache-authcookie

mod_perl Authentication and Authorization via cookies
Perl
3
star
6

milter-limit

Rate limiting milter for Sendmail
Perl
3
star
7

tie-ixhash-fixedsize

A fixed size Tie::IxHash module for Perl
Perl
2
star
8

ng-daily-wallpaper

program that sets National Geographic's Photo of the Day as your Gnome background
2
star
9

dotfiles

my dotfiles
Vim Script
2
star
10

sys-signals-block

simple interface to block delivery of signals in perl
Perl
2
star
11

perl-log-dispatch-filerotate

Log to files that archive/rotate themselves
Perl
2
star
12

pod-weaver-section-sourcegithub

Pod::Weaver plugin to add a SOURCE pod section for a github repository
Perl
2
star
13

template-plugin-filter-minify-css

CSS::Minifier filter for Template Toolkit
Perl
2
star
14

env-c

Get/Set/Unset Environment Variables on the C level
C++
2
star
15

perl-number-libphonenumber

Perl interface to Google's libphonenumber library
Perl
2
star
16

template-plugin-filter-minify-javascript-xs

JavaScript::Minifier::XS filter for Template Toolkit
Perl
2
star
17

spring-sliced-resources

Library to add support for SlicedModel and SlicedResourcesAssembler for Spring Applications
Java
1
star
18

apache2-filter-css-less

Filter CSS LESS files into CSS files under mod_perl on Apache 2.x
Perl
1
star
19

perl-Date-Calc

perl module Date::Calc
Perl
1
star
20

epp-rtk-java

Fork of http://sourceforge.net/projects/epp-rtk/
Java
1
star
21

template-plugin-filter-minify-javascript

JavaScript::Minify filter for Template Toolkit
Perl
1
star
22

template-plugin-map

Map VMethod for Template Toolkit
Perl
1
star
23

milter-limit-plugin-berkeleydb

BerkeleyDB driver for App::Milter::Limit
Perl
1
star
24

Cache-Cache

Release history of Cache-Cache
Perl
1
star
25

dist-zilla-plugin-docker

Dist::Zilla Plugin to Push Release Images to a Docker Repository
Perl
1
star
26

milter-limit-plugin-sqlite

SQLite driver for App::Milter::Limit
Perl
1
star
27

perl-data-validate-dns-caa

Validate DNS Certification Authority Authorization Values
Perl
1
star
28

task-belike-mschout

Use CPAN the way MSCHOUT does
Perl
1
star
29

app-postfix-srsd

Sender Rewriting Scheme Socketmap Daemon for Postfix
M4
1
star
30

template-plugin-filter-string-truncate

String::Truncate filter for Template::Toolkit
Perl
1
star
31

srs-milter

C
1
star
32

template-plugin-filter-minify-css-xs

CSS::Minifier::XS filter for Template Toolkit
Perl
1
star
33

dist-zilla-plugin-apachetest

Dist::Zilla plugin to build a Makefile.PL that uses ExtUtils::MakeMaker with Apache::Test
Perl
1
star
34

dist-zilla-pluginbundle-mschout

use Dist::Zilla like MSCHOUT does
Perl
1
star
35

pod-weaver-section-bugsrt

Add a BUGS Pod section for rt.cpan.org
Perl
1
star
36

apache-profiler

log time spent processing every apache request
Perl
1
star