Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




D.5. Processing Templates

In addition to the ttree script mentioned earlier, tpage is distributed with the Template Toolkit for no-frills simple template processing.

You might use it like this:

panic% tpage myfile.tt2 > myfile.html


panic% tpage src/myfile.html > dest/myfile.html

It is extremely useful as a command-line tool to process a template without having to write any Perl code. However, for most uses, be it an offline script, CGI application, or mod_perl handler, you'll want to hook the Template module into your Perl code.

To see how we would go about this, let us first take one of our earlier examples and save it in a file called example.html (see Example D-1).

Example D-1. example1/example.html


  Published courtesy of O'Reilly Design by Interspire