Skip to Content
Perl Template Toolkit
book

Perl Template Toolkit

by Darren Chamberlain, Andy Wardley, David Cross
December 2003
Intermediate to advanced
590 pages
14h 14m
English
O'Reilly Media, Inc.
Content preview from Perl Template Toolkit

Chapter 12. Dynamic Web Content and Web Applications

In Chapter 2 and Chapter 11, we looked at some basic, and then some more advanced techniques for generating static web content. The fundamental limitation of static web pages is, rather obviously, that they are static. The Template Toolkit allows you to incorporate any kind of dynamic data into a template as it is being processed. But once the page has been generated, the data is fixed. If you want to use different data, you must process the template again.

Most web content is static. The page is generated offline from a template, using a page design tool, or perhaps just typed in at a text editor. It is then uploaded to the web server where it is delivered time and time again without changing. Simple, fast, and efficient.

Some web content is dynamic. The results from a search engine are a perfect example of a dynamically generated page. There’s no way of generating the page in advance because you don’t know what search terms the user is going to enter. There are many other examples of dynamically generated web content to be found at news sites, in bulletin boards and chat rooms, and of course in e-commerce applications, where pages showing the latest offers or the contents of a user’s shopping cart must be generated dynamically to incorporate the latest live data.

In this chapter, we will look at generating dynamic web pages using the Template Toolkit. We will start with some simple CGI scripts to illustrate the basic principles, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Perl Best Practices

Perl Best Practices

Damian Conway
Perl by Example

Perl by Example

Ellie Quigley
Advanced Perl Programming

Advanced Perl Programming

Sriram Srinivasan
Perl in a Nutshell

Perl in a Nutshell

Nathan Patwardhan, Ellen Siever, Stephen Spainhour

Publisher Resources

ISBN: 0596004761Errata Page