Joined: 07 Aug 2003
|Posted: Thu Sep 30, 2004 11:32 am Post subject: Book Review - CGI Programming using Perl, 2nd Edition
CGI Programming with Perl (2nd Edition)
Author(s): Scott Guelich, Shishir Gundavaram, Gunther Briznieks
Publisher: O'Reilly www.oreilly.com
Date Published: 2000 (2nd Edition)
Book Specifications: Softcover, 451 of pages
Reviewer's Recommended User Level: Introductory to CGI, requires entry-level Perl knowledge
Suggested Publisher Price: $34.95 USA/ $51.95 CAN/ Ł24.95 Net UK
Info from back
“CGI Programming with Perl shows how to use CGI to deliver dynamic content on your website. Based on the best-selling CGI Programming on the World Wide Web, this edition has been completely rewritten to demonstrate current techniques available with the CGI.pm module and the latest versions of Perl. The book starts by explaining how CGI and the underlying HTTP protocol work, and then moves quickly into the important details of developing CGI programs.”
The World Wide Web has come a long way since its inception by Tim Berners-Lee, and is totally unrecognizable in its latest avatar from the melee of static pages and images it once was. Its applications have changed completely, and the need to maintain a high level of interactivity with its users has led to dynamically created pages being the requirements of the day. The latter have always fascinated me, and this book seemed like a good way to get intimately acquainted with using Perl for such applications. I also looked at the book from the security perspective, since a majority of exploits on the web are coded in Perl, which itself is widely regarded to be the Swiss Army Knife of the Web.
This book does NOT teach you Perl from scratch. The authors state explicitly that know-how of setting up the Apache web server, and entry level Perl is a pre-requisite. There are a number of good resources on the above, the most notable being Programming Perl (3rd Edition) by Larry Wall. It does however express simply the finer nuances of using Perl in a variety of applications. My main intention when reading this book was to be able to get a grasp of what CGI programming is, and how Perl can be used to create Dynamic websites. This book is highly recommended for those interested in adding yet another powerful tool to their skill-set.
Details of updated material
The book targets beginners to any kind of CGI programming, and is very efficiently organized. The progression of the chapters is such that a continuous flow is maintained for the introductory topics, meaning a new reader will have no problems in mastering the basics very quickly. The book then presents alternative technologies which can help add pizzazz to a normal Perl/CGI site, and goes on to self-contained topics which can be read independently.
The book is organized into 17 chapters, and 2 appendices.
Chapter 1 presents a general introduction to CGI, including its history, web-server configuration (a brief look), and a sample CGI script to initiate the reader into the world of Perl/CGI!
Chapter 2 – 4 cover the basics of CGI – an overview of HTTP, and then a look at how CGI is built on top of it. An introduction is then made to the Form tags of HTML, which are by far the most common method of taking input into CGI scripts.
Chapters 5 and 6 look at popular modules like CGI.pm and HTML Templates which help generate dynamic HTML easily. Several alternative techniques of doing the above are also covered.
Chapters 8 – 13 deal with providing solutions for common CGI bottlenecks. These include topics such as online security (encryption, data storage), data persistence using DBI and DBM , tracking users across web pages, as well as specific topics like sending email (basic concepts, sendmail, mailx), search engines and creating dynamic images using the GD library (also includes PerlMagick).
Chapter 14 covers middleware and XML, which enable CGI scripts in Perl to interact with other types of information servers.
Chapters 15 – 17 explain how to write better CGI scripts by discussing strategies for debugging those, guidelines for writing good and legible code, and efficiency as well as performance improvement methods.
The 2 appendices contain a bibliography and web references, as well as a guide to the most commonly used Perl modules like CPAN and Perldoc.
Style and Detail
O’Reilly has pulled off a virtual coup by getting the 3 authors of this book together in order to create the 2nd Edition. It comes across as a very well written book – no compromises on its technical content and yet, very lucidly expressed. As befits a programming book, it leads the reader into learning by experimenting with the examples. Sample source code and configuration file internals abound, and tables concisely summarizing already discussed concepts make for very interactive reading.
As with all other O’Reilly books, this one too has an easy going pace, and is sure not to overwhelm its readers with too much detail at the same time.
To conclude, this book will appeal to the large majority of hackers out there who want to master CGI programming. Combining the best of good research, vast experience of the authors, excellent expression of all matters technical, and simple language, this is one book deserving a permanent spot on your bookshelf.
A suggestion to would-be readers is to achieve some level of familiarity with Linux, the Apache web server and Perl. Although Windows may be used with the above tools (which are both open source and cross-platform) the authors have used Linux as the illustrative OS, and most discussions tend to be with reference to it. Advanced Perl knowledge is not required – those into programming and logic should be able to understand most of the topics and their accompanying code, and thus learn the language as they go along. It is better however, to know the basics of Perl before you start with CGI.
In all, a well written book which doesn’t overtly drag its readers into details, instead making them learn by actual coding and examples. This book received a 9/10 from me.
This review is copyright 2004 by the author and Security-Forums Dot Com, and may not be reproduced in any form in any media without the express permission of the author, or Security-Forums Dot Com.