For the original English version, see http://www.masonbook.com /.
Introduction
Mason is a powerful template engine that can embed Perl into text. It provides many features to help you use reusable components to create dynamic web sites. In addition, it provides many other features:
- You can create standard, reusable components such as header, footer, or menu. You only need to make changes in one place.
- Complete Web Request Parameter processing.
- Built-in cache, which can be accessed through the cache interface.
- Integrate mod_perl to provide faster speed and better elasticity.
- Content filtering is supported from a small segment of a component to the entire site.
The book "embedding Perl in HTML with Mason" details the HTML: Mason framework, including the following chapters: component format, mason object interface, a simple site example, tips for use, details of Mason's advanced features, and how to use them.
Preface
Mason is a tool that embeds Perl programs into text, so that we can dynamically create text (most of the time HTML pages ). Mason can also easily create XML, WML, POD, configuration files, or all of Shakespeare's books.
Mason was initially developed in 1996 by Jonathan Swartz with the help of other CMP developers at CMP media. Its initial form is scribe.
Mason released version 1.0 in. At this time, Jonathan Swartz invited other humble authors to join in future Mason development. As Mason continues to grow, it was rewritten in the later stages and changed dramatically. This book is based on Mason 1.12.
Target Audience
This book assumes that the reader has a moderate understanding of Perl, and the usage of Perl will not become an obstacle for you to move forward. Before you need to write your own Perl module, the object-oriented method that you are familiar with Perl will benefit you a lot.
Since Mason applies more to website generation, this book provides examples by generating HTML pages. It is clear that you do not need to be an HTML expert when reading this book, but the basic understanding of HTML is helpful for you to understand the target output of the example.
As mentioned above, Mason can easily generate dynamic texts of any kind, including Markup languages such as XML, configuration files, and mail bodies (You may consider mail merging ), or even code.
Finally, the experience of mod_perl and Apache will be helpful for reading chapter 7th and Chapter 9th. they discuss the integration of Mason with mod_perl and CGI respectively. The rest of this book should be easy to understand, regardless of your understanding of these special topics.