Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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

1 Answer 1

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
    
template-toolkit.org/docs/tutorial/Web.html ; 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: stackoverflow.com/questions/3790253/…). –  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

 
discard

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.