Web Development with Apache and Perl

The Perl Journal June 2003

By Jack J. Woehr

Jack is an independent consultant specializing in mentoring programming teams and is also a contributing editor to Dr. Dobb's Journal. His web site is http://www.softwoehr.com/.


Web Development with Apache and Perl
Theo Petersen
Manning, 2002
560 pp., $44.95
ISBN 1-930110-06-5

Web Development with Apache and Perl, by Theo Petersen, is a nice, tight book about classic CGI for interactive web sites. It's a pretty comprehensive overview of what we have been doing in Perl for almost a decade now to create and handle forms and dynamic content. This volume is eminently worthwhile for anyone who is not already a complete expert in the domain.

I've been enjoying this one and reading it cover to cover because I'm not a complete expert in the domain. I jumped into Java very early (1996) in the Web era and never looked back. While I have coded trivial CGI in the past, it's nice to revisit the topics covered by this book at the height of maturity of this programming niche and its code base. In addition, it's much easier to grasp the Perl-coded CGI conceptual framework than it was before module CGI and all the other fine CPAN stuff referenced in the work went online.

As is typical with Manning Publications, Petersen has his own page on the Manning web site (http://www.manning.com/ petersen/) at which one can find reviews, source code, a sample chapter, and the author participating in a forum with his readers online.

The book is divided as follows:

Part 1: Web site basics

1. Open Source

2. The web servers

3. CGI scripts

Part 2: Tools for web applications

4. Databases

5. Better scripting

6. Security and users

7. Combining Perl and HTML

Part 3: Example sites

8. Virtual communities

9. Intranet applications

10. The web storefront

Part 4: Site management

11. Content management

12. Performance management

with many subsections to the sections shown above.

There is circumstantial evidence that this book ran late in its publishing cycle and was rushed a bit in the final stages. Despite the 2002 copyright date, the table of contents listing on the web site (apparently directly from the author's original outline) doesn't literally match the above, apparently due to last-minute changes, which left some inconsistencies in typographical styles. Aside from minor flaws of this sort, the book flows nicely and is well conceived, well designed, and well executed.

Petersen requires little of the reader aside from a familiarity with Perl, which he thankfully does not waste page space attempting to teach in this appropriately sized volume. He assumes the reader may need an introduction to open source and web servers. This will serve most readers well, but additionally places this book squarely on the "must-read" shelf for a multitude of OS/400 and z/OS programmers, whose platforms support Perl and Apache, but who may be less familiar with them.

When moving up from the study of component techniques to the study of complete interactive web sites, the book does more than plough through its own excellent and feature-filled examples. The analysis includes real-world sites such as slashdot.org and imdb.com. The web storefront example could serve as a template for creating your own online order taker. But perhaps closer to most readers' experience is the virtual communities chapter, which shows how to create online forums. You might rather download one of the complete forum packages found around the open-source world, but it's probably a good exercise to build one yourself.

The book doesn't include the word "Apache" in the title in vain. Much space is devoted to examining, explaining, and fine tuning the interaction of Apache and Perl. I haven't encountered a better introductory-to-intermediate discussion of this subject elsewhere. The performance-management chapter at the end of the book is quite juicy with insight.

Perhaps the least satisfactory part of the book,through no fault of the author,is the section on Perl access to databases. What is present is perfectly adequate for the author's task of bringing the reader along to the creation of complete CGI-driven sites, but this subject drips with complexity and begs for a complete book or bookshelf on its own.

If there's a unifying theme to the book, it's the modularity of Perl coding. It's impossible to become productive in lone-wolf mode in this modern world: Being adept at Perl software engineering is almost identical to being adept at using CPAN modules. Many readers may take for granted the object coordination of contemporary Perl practice, but I still marvel at the accomplishment of the community in building up such a complete repertory with a level of integration and teamwork idealized but almost unthinkable in the 1980s.

Theo Petersen is clearly an excellent Perl coder and an accomplished tech writer who has managed to sum up an entire programming discipline in a pleasingly concise fashion. If you are writing CGI-driven interactive web sites using Perl, and you're not sure whether you need this book, you probably do need it.

TPJ