CGI Programming with Perl, Second Edition
By Scott Guelich, Shishir Gundavaram, Gunther Birznieks
June 2000
Pages: 470
ISBN 10: 1-56592-419-3 |
ISBN 13: 9781565924192




(Average of 12 Customer Reviews)


Description
The Common Gateway Interface (CGI) is one of the most powerful methods of providing dynamic content on the Web. CGI is a generic interface for calling external programs to crunch numbers, query databases, generate customized graphics, or perform any other server-side task. 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. Topics include incorporating JavaScript for form validation, controlling browser caching, making CGI scripts secure in Perl, working with databases, creating simple search engines, maintaining state between multiple sessions, generating graphics dynamically, and improving performance of CGI scripts.
Full Description
Programming on the Web today can involve any of several technologies, but the Common Gateway Interface (CGI) has held its ground as the most mature method--and one of the most powerful ones--of providing dynamic web content. CGI is a generic interface for calling external programs to crunch numbers, query databases, generate customized graphics, or perform any other server-side task. There was a time when CGI was the only game in town for server-side programming; today, although we have ASP, PHP, Java servlets, and ColdFusion (among others), CGI continues to be the most ubiquitous server-side technology on the Web.
CGI programs can be written in any programming language, but Perl is by far the most popular language for CGI. Initially developed over a decade ago for text processing, Perl has evolved into a powerful object-oriented language, while retaining its simplicity of use. CGI programmers appreciate Perl's text manipulation features and its CGI.pm module, which gives a well-integrated object-oriented interface to practically all CGI-related tasks. While other languages might be more elegant or more efficient, Perl is still considered the primary language for CGI.
CGI Programming with Perl, Second Edition, offers a comprehensive explanation of using CGI to serve dynamic web content. 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 at the beginning, by explaining how CGI works, and then moves swiftly into the subtle details of developing CGI programs.
Topics include:
- Incorporating JavaScript for form validation
- Controlling browser caching
- Making CGI scripts secure in Perl
- Working with databases
- Creating simple search engines
- Maintaining state between multiple sessions
- Generating graphics dynamically
- Improving performance of your CGI scripts
Featured customer reviews

A valued book I wouldn't part with,
February 14 2008
Submitted by
Andrew Mott
[
Respond |
View]
CGI Programming with Perl by Scott Geulich, Shishir Gundavaram, and Gunther Birznieks is a great beginning book for those interested in web programming with Perl. I have owned this book since its publication, and though it is about eight years later, I still reference back to this book. It is a joy to read.
The book covers these topics and more:
HTTP Protocal (Basic summary of how the web works)
URLs (Each part and what they do)
CGI (What it is, and how to use it)
Processing HTML Forms with CGI
CGI.pm for Perl (Including other options)
HTML Templates
Javasctipt
Security (Very Important)
Sending Email
Data Persistence (Making text files, Using SQL & Databases)
Maintaining State (Cookies, Hidden Fields, URL)
Web Searching
Creating Graphics with Perl & GD
XML Intro, Parsing XML
Debugging
Tips for Better CGI Applications
Efficiency and Optimization
Everything you need to get started for building web based applications is available in this book. It is a great introduction to other technologies as well as Perl & CGI. Basic things a begginer would want to learn how to do (Send Email, Process Forms, Maintain State, Data Persistance) is included here. However, this book is quite old. I suppose because of the proliferation of mod_perl, PHP, and others technologies, that this book has yet to be updated. I find it useful currently in its old state, but I am sure updates could be provided, obviously in places where other technologies are referenced and described as alternatives to CGI with Perl.
Some Dated Material, Still Useful,
January 14 2007
Submitted by
Matthew Weigel
[
Respond |
View]
The most recent thing I came to this book looking for, good information on how to handle sessions, simply isn't there, CGI::Session and Apache::Session aren't discussed at all. On the other hand, important performance topics (like using fastcgi or mod_perl, normal Perl optimization, etc.) are still useful.
CGI Programming with Perl, 2nd Edition Review,
March 14 2006
Submitted by Anonymous Reader [
Respond |
View]
Hi,
Looks like I've run into the same problems as yourself when trying to get example 11.2 to work. I keep getting an Apache 404 error when I try to follow one of the links generated by the script on a previous call. Looks like Apache checks for existence of document before calling the "query_track.cgi" script - which is never going to exist because it includes the "extra path information"!. I wonder whether you experienced the same and got around it??
Regards
jim
Read all reviews
CGI Programming with Perl, 2nd Edition Review,
December 29 2003
Submitted by tadziu
[
Respond |
View]
Your misssing some files that are necessary to understand the principles.
There were several missing already in previous chapters. In chapter 7 for instance, you do not provide - "music_data.txt" - so the online example of music_browser.cgi cannot be tried out.
Another one is in Chapter 6. I need "rgb.txt" to get the xcolors.cgi to work. You did not provide it.
I find this frustrating - particularly since I paid $35 for the book. And I'm not getting the full benefit of the book.
tadziu
CGI Programming with Perl, 2nd Edition Review,
April 27 2003
Submitted by Tor
[
Respond |
View]
The book covers all the important stuff, it is easy to read, and has insightful comments and good examples. The comments below should be seen in that contexts.
Unfortunately, it seems to be poorly edited. There are many typos, and the example scripts typically have one or several bugs in them. Even today, three years after release, the downloadable scripts need debugging!
This is actually quite frustrating, as you can't take those scripts for granted. If you want to learn by modifying you don't know if it is your modification or the original script that caused your problems.
CGI Programming with Perl, 2nd Edition Review,
October 21 2002
Submitted by Paul Dyer
[
Respond |
View]
This is good book that covers a wide area. Each chapter can be read faily quickly, but to really learn it is necessary to do the examples.
Unfortunately, there has been a poor job of editting. There are many typo and grammatical errors, in addition to code problems. I have found that at least 90 percent of the examples do not work without a skilled debugging session. I was able to get all code to work, except for examples 11-2, 11-3 on Maintaining State, and examples 14-4, 14-5 on "Whats Related". Example 14-4, 14-5 will probably never work again because the web server it uses is now commercialized.
In particular, chapter 11 was very poorly written and needs to be completely re-worked. Too bad, it is a very important topic.
Overall, this is still a very good book. It serves as a great intro into CGI web programming.
CGI Programming with Perl, 2nd Edition Review,
June 29 2001
Submitted by Aaron Hillyer
[
Respond |
View]
A
must have for any web developer from novice (assuming knowledge of Perl) to advanced.
I found this book to be an all-encompasing overview of the world of CGI and it is really a quick read. While it is an overview, don't be fooled into thinking that it has nothing to offer you because it's knowledge is vast. Check out the sample chapter on security to see what I mean. Furthermore, it servers the additional purpose of a great reference. If you're doing anything on the web,
buy this book.
CGI Programming with Perl, 2nd Edition Review,
February 23 2001
Submitted by Dan Woodruff
[
Respond |
View]
Great source for a semi experienced programmer. The level of detail is perfect for my understanding. The source for the examples is unaviable in Windows environment though. I would have liked to see more comparison on other technology and less of cgi.pm
CGI Programming with Perl, 2nd Edition Review,
September 03 2000
Submitted by Medhat M. Saleh
[
Respond |
View]
This is a truely rewarding book. It is an excellent choice for an experienced programmer who is starting to learn CGI or had been doing a little bit of it, and now needs more ! Surely, you will find your self looking for more details elsewhere; but that is unavoidable for a comprehensive book, even a good one like this one.
I share the sentiments of an earlier reviewer towards waiting for the UPS truck!
CGI Programming with Perl, 2nd Edition Review,
August 07 2000
Submitted by Nico Piccirilli
[
Respond |
View]
Truly a different animal!
Shows you how to put it all together.
A must for any aspiring web developper.
CGI Programming with Perl, 2nd Edition Review,
July 27 2000
Submitted by T W Foy
[
Respond |
View]
A great book that teaches you why not how. This book doesn't teach you Perl, it assumes you know
Perl - instead it teaches you all the tricks with using Perl on the web. Useful both as an introductory guide and as a quick-reference manual.
CGI Programming with Perl, 2nd Edition Review,
July 24 2000
Submitted by Jorge Wurlitzer
[
Respond |
View]
Great stuff on graphics! Good code examples on the download. A must have for any Perler!
CGI Programming with Perl, 2nd Edition Review,
July 19 2000
Submitted by Jeff "japhy" Pinyan
[
Respond |
View]
Well written, with an excellent list of resources in the back -- RFCs, books, and more.
Some of the chapters are surprisingly short, and there are some typos, but nothing heart-stopping that I found.
Covers approaches other than Perl, including JavaScript. Explains the interface of CGI.pm quite well, in only a chapter.
Nice section on HTTP status codes you might return from a CGI program.
I was really hoping for a section on native query parsing -- perhaps a nitty-gritty CGI document is needed (which I happen to be writing).
All in all, a nice read. I was waiting all day for that UPS truck. :)
CGI Programming with Perl, 2nd Edition Review,
April 27 1999
Submitted by Jim H
[
Respond |
View]
Hi,
I found the original book a useful introduction to CGI programming.
However, I'm disappointed to see the release date of the 2nd edition appears to have slipped from June 1999.
Nevertheless, I'm sure it'll be worth the wait.
CGI Programming with Perl, 2nd Edition Review,
April 19 1999
Submitted by Neal Magee
[
Respond |
View]
I was disappointed to find out that the second edition is coming out when I just bought the first!
I knew it was outdated slightly, and am looking forward to how it handles new developments in web technology.
I have been very impressed with its practicality and how well it explains what is going on. Keep up the good work.
nem
CGI Programming with Perl, 2nd Edition Review,
December 21 1998
Submitted by A possible customer.
[
Respond |
View]
I would like to see a *preliminary* Table of Contents. Also, please specify whether this is a supplement or replacement for "CGI Programming on the
World Wide Web". What level of knowledge is expected for this book? Compare with related O'Reilly titles.
CGI Programming with Perl, 2nd Edition Review,
July 08 1998
Submitted by Suresh V Kumar
[
Respond |
View]
Found the 1st edition. Dated March 96. Made me to look
for a 2nd edition. But covers very useful tips, it took
me only a few minutes to create my own guestbook and
access counter.
Hope the 2nd edition will have more examples
covering popular shareware SQLs (PostgreSQL etc).
Will be helpful if the source code is available to download.
Congratulations and goodluck with the new edition.
Suresh V Kumar
Media reviews
"The introductory chapter explain the function of CGI and HTTP...regardless of whether or not one wants to program CGI with Perl, this part of the book is recommended as one of the best accounts of what CGI does and how it works...I found the discussion on the use of regular expressions in validation of email addresses particularly absorbing"
--Major Keary, Book News, March 2004
"Top 3 Perl/CGI books. This is a good reference for CGI programming. It has a lot of good information worth keeping on your desk."
--Emmie Lewis, About.Com Perl/PHP Guide
"excellent! If you learn best with a book, this is probably the one to get."
--Charlie Stross, Linux Format, June 2001
Read all reviews