<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>Book Review: Embedding Perl in HTML with Mason</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Embedding Perl in HTML with Mason</FONT>
<BR><FONT SIZE=2>Authors: Dave Rolsky, Ken Williams</FONT>
<BR><FONT SIZE=2>Publisher: O'Reilly</FONT>
<BR><FONT SIZE=2>Published: 2002_10_01</FONT>
<BR><FONT SIZE=2>ISBN: 0596002254</FONT>
</P>

<P><FONT SIZE=2>&quot;Embedding Perl in HTML with Mason&quot; (EPIHWM) is as you might guess from the title, a book about creating dynamic websites with the HTML::Mason module. If you're wondering what is HTML::Mason? I don't think it would be unjust to describing it as either a heavyweight templating system or a lightweight application framework. I.e., it falls somewhere between Template::Toolkit and Zope. And like Template::Toolkit, Mason need not be limited to generating websites, but can be used to generate configuration files, static documents, etc. This book however reflects the task Mason is most frequently put to, that of building dynamic websites that are feature rich yet easily maintained and extended.</FONT></P>

<P><FONT SIZE=2>Mason is built around the concept of components as building blocks. I.e., KISS through modularization and the elimination of redundancy. &quot;Components&quot; are similar in nature to packages, but consist of text intermixed with embedded Mason tags that allow you to take full advantage of Perl. These components can call out to or be composed of other components. Components can be implemented procedurally, or using inheritance, methods, attributes, etc. In short, Mason assures that TIMTOWTDI.</FONT></P>

<P><FONT SIZE=2>As someone who is about 5 years behind the times with regard to web development related standards and tools, and working to catch up I choose to read &quot;Embedding Perl in HTML with Mason&quot; because it appeared to be the best all round introduction to a templating system. Had Template::Toolkit had available similar well rounded documentation I might just as easily have started with it. Though I'll admit that the fact that Mason provides pre-rolled solutions for caching and a lot of the management hooks that would otherwise require a good bit of hands-on and trial by fire experience. Though I hope never to make use of it, I also liked that Mason will work under CGI and in a stand-alone mode. In choosing to start with Mason and EPIHWM I was not disappointed.</FONT></P>

<P><FONT SIZE=2>The book assumes intermediate experience with Perl and passing familiarity with HTML, Apache and CGI.pm. By intermediate, I mean that the reader should be comfortable downloading and installing modules from CPAN and have a passing familiarity with using object oriented interfaces. The book is published by O'Reilly under the Open Publication License, and also freely available at the <A HREF="http://www.masonbook.com" TARGET="_blank">http://www.masonbook.com</A> website.</FONT></P>

<P><FONT SIZE=2>The authors start with an overview of Mason's features, give a short comparison to alternative templating systems, and then move on to a through discussion of the Mason syntax and components. They do a good job illustrating concepts with examples throughout. They steadily work into more advanced topics like Mason's default handlers which are similar to AUTOLOAD in that they allow you to dynamically provide code to handle requests for uri's that don't exist, and autohandlers which allow existent components to easily inherit and share code. An example of a frequent use of autohandlers would be to provide standard headers, footers, and menus.</FONT></P>

<P><FONT SIZE=2>The next few chapters flush out Mason's API, advanced features, give a glance under the hood at how Mason works, and illustrate how Mason can take advantage of Apache mod_perl when it is available. Finally in chapter 8, it all comes together as the authors build a complete site using Mason. It just so happens to be the Perl Apprentice site, which you can visit at <A HREF="http://apprentice.perl.org" TARGET="_blank">http://apprentice.perl.org</A>.</FONT></P>

<P><FONT SIZE=2>The last few chapters cover Mason in the absence of mod_perl, i.e., under CGI. They then hit on scalability issues and provide various recipes for maintaining state, authentication, authorization, and tips on sharing Mason components to generate similar sites and working in shared development environments. It finishes with a tutorial on subclassing and customizing Mason itself. The appendices contain API references, tips on customizing emacs and vim, and plug for Bricolage which is a content management system built using Mason.</FONT></P>

<P><FONT SIZE=2>All in all, the book was a well written introduction to Mason. There were a few typo's and the errata as usual is available at the O'Reilly website. If you're looking to get started with Mason, look no farther. If you're looking for advanced topics, recipes, and under the hood insights head over to <A HREF="http://www.masonhq.com" TARGET="_blank">http://www.masonhq.com</A>, read the documentation there and consider joining the mason-users mailing list.</FONT></P>

<P><FONT SIZE=2>--</FONT>
<BR><FONT SIZE=2>Garrett Goebel</FONT>
<BR><FONT SIZE=2>IS Development Specialist</FONT>
</P>

<P><FONT SIZE=2>ScriptPro&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Direct: 913.403.5261</FONT>
<BR><FONT SIZE=2>5828 Reeds Road&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Main:&nbsp;&nbsp; 913.384.1008</FONT>
<BR><FONT SIZE=2>Mission, KS 66202&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fax:&nbsp;&nbsp;&nbsp; 913.384.2180</FONT>
<BR><FONT SIZE=2>www.scriptpro.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; garrett at scriptpro dot com</FONT>
</P>

</BODY>
</HTML>