Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 3. The Template Language > Template Variables

3.2. Template Variables

The Template Toolkit's simple-to-access variables are one of its strengths. In this section, we describe the syntax and semantics of variables—what names are allowed, the different types of data that can be stored in a variable, the predefined Template Toolkit variables, and so on.

3.2.1. What's in a Name?

Variable names can contain alphanumeric characters or underscores. They can be lowercase, uppercase, or mixed case, although the usual convention is to use lowercase to avoid confusion with uppercase directives. The case is significant, however, so foo, Foo, and FOO are all different variables. Here are some examples of valid variable names:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial