Embedding Perl in HTML with Mason -  Dave Rolsky &  Ken Williams

Embedding Perl in HTML with Mason

Buch | Softcover
300 Seiten
2002
O'Reilly Media (Verlag)
978-0-596-00225-1 (ISBN)
31,40 inkl. MwSt
Mason, a Perl-based templating system, is becoming more and more popular as a tool for building Web sites and managing other dynamic collections. This text covers the first new release of Mason, which includes a number of changes that users have wanted for a long time.
Mason doesn't aim to be the one true Perl-based templating system for building Web sites, but it's led many programmers to abandon their custom solutions when they've seen how much easier using Mason can be. It's a powerful, open source, Perl-based web site development and delivery engine, with features that make it an ideal backend for high load sites serving dynamic content. Mason uses a concept called components: a mix of HTML, Perl, and special Mason commands. These components can be entire Web pages, or bits of HTML that can be embedded in top-level components. Shared and reusable, these components greatly simplify site maintenance: when you change a shared component, you instantly change all pages that refer to it. Although using Mason isn't difficult, creating a Mason-based site can be tricky. The book shows how to take advantage of Mason's strengths while avoiding the obstacles that inexperienced users may encounter. Mason's unique features, when used properly, can streamline the design of a Web site or application. It covers these features from several angles, and includes a study of the authors' sample site where these features are used.
The book also shows you how to create large, complex, dynamically driven web sites that look good and are a snap to maintain. You'll learn how to visualize multiple Mason-based solutions to any given problem and select among them. The book covers the latest release of Mason 1.12, which has many new features, including line number reporting based on source files, sub-requests, and easier use as a CGI. The only book to cover this important tool, Embedding Perl in HTML with Mason is essential for any Perl programmer who wants to simplify Web site design. Learn how to use Mason, and you'll spend more time making things work, and less time reinventing the wheel. ;

Dave Rolsky is a programmer, author, and activist with a background in music composition and reading science fiction. He has been active in the development of Free (Perl) Software for several years. Dave is part of the core development team for Mason. Ken Williams is a researcher in Document Categorization at the University of Sydney in Australia. He has written many Perl modules of varying utility, and about 20 of which are available on CPAN. Like co-author Dave Rolsky, Ken is a member of the HTML:Mason core development team. His educational background is in mathematics and music.

Foreword Preface 1. Introduction A First Example The Main Features of Mason Alternatives to Mason Philosophy Getting Started with Mason 2. Components Mason from 10,000 Feet Core Concepts Basic Component Syntax Component Arguments Component Return Values Special Globals Sample Component 3. Special Components: Dhandlers and Autohandlers Dhandlers Autohandlers Using Autohandlers and Dhandlers Together 4. APIs Request Class and Object API Component Object API Buffers 5. Advanced Features Subcomponents Creating Components on the Fly Sharing Data Among Component Sections Methods and Attributes Calling Components with Content Blocks Advanced Inheritance Subrequests 6. The Lexer, Compiler, Resolver, and Interpreter Objects Passing Parameters to Mason Classes The Lexer The Compiler The Resolver The Interpreter 7. Using Mason with mod_perl Configuring Mason Document Root Versus the Component Root Not OK $r ApacheHandler Parameters To Autoflush or Not to Autoflush Generating Something Besides HTML Apache::Status and Mason 8. Building a Mason Site Functionality Directory Layout File Extensions Apache Configuration The Components Components with Access Controls All Done Further Directions 9. Mason and CGI CGI-Appropriate Situations CGI-Inappropriate Situations Creating a CGI-Based Site in Mason Using Mason Templates Inside Regular CGI Scripts Differences Between Mason Under CGI and od_perl 10. Scalable Design Modules Versus Components cOmponents as Independent Units Component Layout File Naming and Directory Layout Random Advice 11. Recipes Sessions Making Use of Autoflush User Authentication and Authorization Co-Branding Color Schemes Developer Environments Using Mason Outside of Dynamic Web Sites 12. Custom Mason Subclasses Class::Container as a Superclass Syntax: Your Very Own Lexer Output: Compiling to a Different Output Storage: Replacing the Resolver Request: A Request Object with a Built-in Session Argument Munging: ApacheHandler More Reader Exercises A. The Mason API B. Object Constructor Parameters C. Text Editors That Understand Mason D. Content Management with Bricolage Glossary Index

Erscheint lt. Verlag 19.11.2002
Verlagsort Sebastopol
Sprache englisch
Einbandart kartoniert
Themenwelt Informatik Programmiersprachen / -werkzeuge Perl
Mathematik / Informatik Informatik Web / Internet
ISBN-10 0-596-00225-4 / 0596002254
ISBN-13 978-0-596-00225-1 / 9780596002251
Zustand Neuware
Haben Sie eine Frage zum Produkt?
Mehr entdecken
aus dem Bereich
Keeping the Easy, Hard, and Impossible Within Reach

von Brian D. Foy

Buch | Softcover (2018)
O'Reilly Media (Verlag)
53,85