Top positive review
3 people found this helpful
thorough and interesting
on August 5, 2007
I've worked on enough PHP and other lousy web code to have cringed when I read the title of this book: Embedding Perl in HTML with Mason. "No!" I cried, "don't cross the streams!" By the end of the book, I was feeling much more at ease (but I still cringe a little at that title).Mason is (though it seems debated) a cross between a lightweight application server and a very lightweight templating system. Requests go into Mason, which dispatches them to handlers and produces a response. The handlers and dispatch are simple but powerful: they use ideas object-oriented programming and allow the programmer to easily abstract and reuse code parts.
It seems like a very powerful system, but its programmer-facing interface is fairly simple. The book walked through all the basic Mason concepts (request, autohandlers, dhandlers, components, methods, etc.) quickly, but with sufficient explanation and demonstration to make everything clear. Chapter 8 walked through the construction of a web and database application, using all the major features covered so far. The features had already been so clearly explained that I felt comfortable just skimming through the chapter.
After that, the book began to cover some more esoteric concepts. Mason is made up of a number of classes: an interpreter, a lexer, a compiler, and a resolver. A programmer can write his own class to implement any of these components, changing the system to suit his whims.At the end of all this, I felt like I could really make Mason do a lot of cool things, and that it was a nice-sized solution for a lot of problems. (I still don't see myself actually /using/ Mason for anything, but now I know it's not so bad, and I know how to use it.) The book was well-written, had the right amount of depth, and was the right length for end-to-end reading. I'm glad I read it.