Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Tại trái tim của nó, Mason chỉ đơn giản là một cơ chế để nhúng vào mã Perl đồng bằng văn bản. Nó chỉ là một trong nhiều cơ chế như vậy mà tất cả làm nhiều hơn hoặc ít hơn cùng một điều. Tuy nhiên, Mason đại diện cho một tập hợp các lựa chọn về cách nhúng này nên được thực hiện, và nhiều người đã thấy rằng cách Mason hiện những điều rất đơn giản và cực kỳ thuận lợi cho nhận được công việc làm | Embedding Perl in HTML with Mason Chapter 1 Introduction At its heart Mason is simply a mechanism for embedding Perl code into plain text. It is only one of many such mechanisms that all do more or less the same thing. However Mason represents a particular set of choices about how this embedding should be done and many people have found that the way Mason does things is very straightforward and extremely conducive to getting jobs done. In this chapter we ll introduce you to some of Mason s key features and strengths show you a couple of examples of how to use Mason and talk about some alternatives to Mason. After reading this chapter you should have a fairly good idea of how Mason relates to its peers and what kinds of tasks you can accomplish with Mason. The most common application of Mason is in building large dynamic web sites and this book focuses mostly on web site building. Mason is broadly applicable to any situation in which fine control over document content is required however such as generating mail-merged form letters creating custom configuration file sets and even building dynamic GIF images based on varying input parameters. We intend to give you enough facility with Mason that after reading this book you can imagine Mason-based solutions to problems we haven t ever thought of. Before we get into the details of Mason and comparisons with its alternatives we ll just briefly mention some of its guiding design principles. Mason was designed to help you build organize and maintain large web sites or other groups of dynamically generated documents. It cooperates fully with Perl leveraging all the solutions and techniques that Perl developers have come to depend on and that have made Perl such a powerful and widespread tool. It encourages thinking about your site in structural terms rather than as a collection of procedural scripts or modules. All of these things are conducive to getting your job done effectively letting you concentrate on your goals while