Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can find all sorts of weird information about templates in Perl, but nothing about what they actually are.

Are they generic types like in C++? Is it a class-like structure? Or maybe something else?

share|improve this question
up vote 7 down vote accepted

You don't link to any of the 'weird information' you found, but there is no language construct in Perl called 'templates'.

Generally, I expect the subject of any article on Perl and templating to be about text output; a template to generate HTML, or an email, for example. The Text::Template and HTML::Template modules being canonical examples.

share|improve this answer ; for example. Also, could it have something to do with regex? – Michael Aug 18 '12 at 15:38
@Michael: The tutorial you link to is doing exactly what I described; using a template to produce HTML output. Text templating could be done using regular expressions, but that's not necessary (nor necessarily a good idea). – Martijn Pieters Aug 18 '12 at 15:50
Ok, thanks. Now that I look at it further, the examples given in the link I provided are pretty straightforward. Initially, I googled it and all the sites that came up were awkward (like this:…). – Michael Aug 18 '12 at 21:43
@Michael: Right; that's someone asking for a template to use when starting a new Perl source file. :-) – Martijn Pieters Aug 18 '12 at 22:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.