Embedding Perl on HTML pages Using Mason (excerpt)

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.