Advertisement

Tutorials

Home Books Books
Books

Review

CGI Programming with Perl
by Scott Guelich, Shishir Gundavaram, Gunther Birznieks, Linda Mui

Price: $23.07

Buy the Book

Table of Contents

The appearance of the second edition of CGI Programming with Perl heralds the beginning of the neoclassical era of Web service. CGI or common gateway interface is the original back end for clientdriven, dynamic Web page service and deserves consideration as the Romulus of the Internet Empire.But, where first edition author Gundavaram described the lonely Romulus laying the brick foundation of dynamic Web-page service in 1996, second-edition collaborators Guelich and Birznieks have pitched in to resurrect Romulus amid the crowded streets of modern Rome. Why bother? Surely four years have brought technological revolutions (Java, PHP, ASP, ColdFusion) that render CGI's original brick-by-brick approach as obsolete as, say, Roman mythology or bricks and mortar.
And yet not. It is an ambiguous blessing that the original CGI persists, adhering to the underside of Web service by the duct tape that is Perl. This point is not missed by Guelich, Gundavaram, and Birznieks, whose advocacy of CGI is both bolstered by the growing applications module base of Perl and tempered by their awareness of CGI's structural limitations. Both new and returning readers of CGI Programming with Perl should browse the last chapter first in order to appreciate the proposed solutions to CGI's greatest sin: its impractical slowness in a world of a million-hits-per-day Web service. The chapter describes CGI-compatible FastCGI and mod_perl technologies that circumvent the process-spawning slowness of the simple CGI. Advanced users might want to skip directly to O'Reilly's fine mod_perl tome, Writing Apache Modules with Perl and C, by Lincoln Stein and Doug MacEachern.
The authors' second pass at CGI pedagogy is a lucid, honest, and expanded account that develops functionality of dynamic Web pages in a rational progression from HTML client-server and CGI syntax basics to general input/output, forms, e-mail, graphics, and simple database applications, including maintaining client state and data persistence under the otherwise stateless HTTP protocol. The authors offer synopses of cookies, JavaScripting, server security, and XML, all of which are described in detail in other books.
Whether or not neoclassical CGI is fast enough for your purposes--perhaps for guarded intranets--bear in mind that CGI is the standard to which every other Web server has had to respond. The second edition of CGI Programming with Perl is still the best introduction to the classics. Review by Peter Leopold

Reviewer: sherzodr (see more about me) from Mount Pleasant, MI United States While there're a few boooks available on CGI/Perl, what's different in this book you'd ask. If we compare it with "CGI.Programming 101" by Jaqueline, it's more advanced and excersices better programming style.Uses 'strict' pragma and -wT switches ALL THE TIME, which I liked a lot.The programs are also compatible in mod_perl enviroment, which prove the fluency of the authors in Perl and Web Programming.
Unfortunately their those capabilities don't make them good writers. They don't spend enough time on some of the concepts they introduce. They sepend more time and space then requried on JavaScript(chapter 7), which is about 23 pages, and spend only 16 pages on Data Persistence (chapter 10). But in Data Persistence chapter they tried to cover Text files, all kinds of file lockings, temporary files, DB_File, MLDBM, SQL, DBI. Now you have a rough picture of how dEtAiLeD their topisc are. Here I'll try go over chapters with comments and will be suggesting alternatives for the topic wherever it's applicable
Chapter 1, 2 and 3 give some history of the WWW and CGI. Also provide a smaple CGI application for getting started. I think chapter 2, "Hypertext Transfer Protocol" was pretty informative, and I ejoyed it a lot.
Chapter 4, "Forms and CGI" go over some form anatomy and elementary ways of encoding and decoding form input, which you might find usefull.
Chapter 5 is entirely dedicated to CGI.pm and it's application. I still think CGI.pm's documentation available online (or with your Perl distribution) does way better job than this one chapter.
Chapter 6, "HTML Templates" gives some nice examples of HTML::Template and Embperl usage. They spend good space on these, but only about 3 pages to cover Mason. Of course, the chapter can't take you too far without the original documentations of those mentioned libraries which are available online.
Chapter 7, as I mentioned was dedicated to JavaScript and JS validation. I think they were not supposed to spend so much time on JavaScript. For this one, go get JavaScript Bible, 4th edition by Danny Goodman.
Chapter 8, Security covers the security guidelines already available online as W3C's security FAQ by L. Stein and John Stewart.
Chapter 9, "Sending Email" was probably my favorite. It covers 'sendmai', mailx and mail and procmail. Spends good 18 pages on the topic and shows an examile that uses Mail::Mailer
Chapter 11, Maintaining State, was really poor. There's nothing much to learn in that chapter. For more profesional session management examples, I suggest you "MySQL and Perl for the Web" by Paul DeBois and Apache::Session manual available online.
Chapter 12, "Searching the web" give some advanced examples of web searching. The example of Inverted Index Search using DB_File was my favorite.
Chapter 13, "Creating Graphics on the fly" give some examples of dynamic graphic generation using GD, Image::Magick and GD::Graph. I could give this chapter hmmm... 3 stars :)
Chapter 14, "Middleware and XML" was the one I just skipped over.
The last 3 chapters of the book are dedicated to debugging, coding with style and eficiency with mod_perl and FastCGI.
For debugging and style, I recommend "Programming perl 3rd edition".
Overall, I benefitted from the book a lot as it implies from my review. But still wanna save my 5 stars for the 3rd edition :)

Advertisement

Partners

Related Resources

Other Resources

image arrow