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?


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.

| 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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