From the book lists at Adware Report:

All information current as of 17:35:27 Pacific Time, Thursday, 16 December 2004.

Writing CGI Applications with Perl

   by Kevin Meltzer / Brent Michalski

    Addison-Wesley Professional
    15 February, 2001

   --price not specified--   

   This item is currently not available.

Click the button below to . . .

(which will add the book to your Amazon U.S.A. "Shopping Cart")

. . . or use your browser's Back button to return to the search-list page.

Editorial description(s):

From Book News, Inc.
Two longtime Perl programmers show how the CGI scripting language can accomplish the tasks needed for many online applications. Each chapter covers a specific Web-based application and explains the code line by line (or block by block). Each application works but is incomplete; to show users how to write the software themselves (rather than simply providing copy-and-paste code), Meltzer and Michalski leave out certain features and suggest what can be added based on information from different chapters. Includes an introductory overview for users new to CGI or Perl.Copyright © 2004 Book News, Inc., Portland, OR

Book Info
(Pearson Education) A guide to writing CGI applications with Perl, showing how to accomplish everyday tasks necessary for online operations. Includes line-by-line code explanations, examples, and skill-stretching exercises. Also covers working with HTML, tracking clicks, and cookies, among other topics. Softcover. DLC: Perl (Computer program language).

From the Back Cover

With its sophisticated database, network, and multi-platform capabilities, the Perl programming language has emerged as an ideal tool for developing CGI-based Web applications.

Writing CGI Applications with Perl shows you how to use Perl to accomplish the most vital tasks needed for today's online applications. Using numerous examples, line-by-line code explanations, and skill-stretching exercises, this book not only provides useful cut-and-paste code for your own programs, but it also teaches you practical skills and techniques that will enable you to develop any kind of CGI-based Web application with Perl.

Focusing on the most important areas of Web application development, including database interaction, form and file handling, security, e-mail, and graphics, the book provides in-depth coverage of such specific topics as:

In addition, introductory material is provided for newcomers to CGI or Perl. Numerous appendices include handy references as well as a guide to Perl documentation. A companion Web site, , contains the code for all the examples.

Geared toward the needs of today's professional Web developers, Writing CGI Applications with Perl provides the specific tools, experienced-based techniques, and overall concepts necessary for quality Web application development.


About the Author

Kevin Meltzer has been using Perl since the early '90s for everything from CGI and system administration to database migrations and report generation. He considers himself a "Perl evangelist," and is the founder of the Hartford Perl Mongers (although he now resides in Florida). Kevin has been published in The Perl Journal, and is the judge of their annual Perl Poetry Contest. He is now working for Verio, Inc. as a Perl developer/engineer.

Brent Michalski discovered Perl around 1994 and has been programming in it ever since. He considers himself a "Perl freak" and loves sharing Perl with others. Brent mainly develops CGI applications because he enjoys the Web so much. He has written articles for Web Review, and currently maintains the Perl area on the Dr. Dobb's Journal Web site. Brent is a senior developer at MasterCard International where they let him play with Perl every day.


Excerpt. © Reprinted by permission. All rights reserved.

Purpose of this Book

Perl's popularity as a CGI scripting language is growing by leaps and bounds. However, there are few books available today that cover this subject in depth including a broad range of concepts. We wanted our book to help people learn to use Perl and convince them that it is the best choice for their Web-based applications. The goal of this book is not to teach the Perl language--although certain tricks and features may be learned--but to show how Perl can accomplish the tasks needed for many of today's online applications. In short, we wanted to provide a resource that not only teaches new uses of Perl but challenges the reader with exercises that use the concepts. Standard Perl documentation is also provided. The book covers a wide range of concepts, and using these, you should be able to write almost any Perl/CGI application with the techniques provided.

This book is different from others about Perl and CGI. It takes a cumulative approach and introduces applications that use concepts learned in previous chapters. Each chapter will cover at least one specific Web-based application and explain the code line by line (or block by block) so you not only learn what the scripts are doing but how they are doing it. And in order to help induce self-learning and application building, each application is working but incomplete. We provide skeleton applications that can stand on their own, but we leave out certain features that can be added (and we suggest adding them in the exercises) using the information in that chapter and in previous chapters. Our goal is not to give you "cut and paste" software but rather to show you how to write the software yourself.

Chapter Summaries

Chapter 1, Perl, CGI, and this Book. This chapter explains what Perl and CGI are. It also supplies more detail about this book and shows how to use the CPAN module.

Chapter 2, What You Should Know. We don't expect the reader to know everything, but we do expect at least a base level of knowledge. This chapter outlines what you should already know and explains a few things that you may not already know but should to get the most out of this book, such as tainting, security concerns, and troubleshooting.

Chapter 3, Using Your Environment. Many times in CGI applications you need information from the client, such as IP address or browser information. This chapter covers how to access the Web server environment variables and what they mean.

Chapter 4, Introduction to Web Forms. There are few online applications where there is not some sort of Web form used to allow an end user to submit information. Chapter 4 explains the HTML elements of creating a Web form, as well as how to obtain the user input.

Chapter 5, Working with Cookies. Using cookies to store data on a Web client can be very useful to record the preferences of and remember things about users. You will learn how to set, get, and use cookies in this chapter.

Chapter 6, Access Counters. Many people want to count how many people come to their Web site. The examples in this chapter show you how to do this.

Chapter 7, Web-Based File Uploading. Here you will learn how to safely allow end users to upload files to a server from their local hard drives.

Chapter 8, Tracking Clicks. It can sometimes be useful to know what links on a Web site are being followed and from where. The examples in this chapter show how to track these clicks.

Chapter 9, Using mod_perl. The popular mod_perl Apache module can be extremely useful when it is appropriate for an application. You will see how to configure mod_perl, as well as how to use and write mod_perl Perl modules.

Chapter 10, Web-Based E-mail. The examples in this chapter demonstrate how to connect to a POP3 server to view e-mail, view attachments, and send e-mail via the Web.

Chapter 11, Introduction to DBI and Databases on the Web. Chapters 1–10 presented basic uses for database connectivity in previous examples. This chapter examines the Perl DBI in more depth.

Chapter 12, Tied Variables. The magic of tying data structures to variables and how to do this when the data structure is a database is explained in this chapter.

Chapter 13, Embedding Perl in HTML with Mason. This popular tool is examined and explained. This chapter shows you how to embed Perl within HTML and use the HTML::Mason module to speed up development and maintenance time.

Chapter 14, Document Management via the Web. By now you will have learned how to upload files to a server. This chapter shows you how to manage your files remotely via the Web.

Chapter 15, Dynamically Manipulating Images. Creating charts, graphs, thumbnails, and galleries, and changing images on the fly are all concepts that can be useful in CGI applications. This chapter shows you how to add these techniques to your software.

Chapter 16, RSS and XML. XML is another tool that is gaining in use and popularity. This chapter shows you how to use both XML and a derivative of it, RSS and RDF, to share information and use in applications.

Appendix A, Server Codes. Learn what the codes returned by a Web server mean.

Appendix B, Environment Variables. This is a list of the most common Web server environment variables.

Appendix C, POSIX::strftime() Formats. This book uses the POSIX module a few times to format date strings. This list shows the formats that the module uses and what the formats do.

Appendix D, General Public License. If you didn't read the copy that came with Perl, you can do so here.

Appendix E, Artistic License. Another license under which Perl is distributed.

Appendix F, Perl Documentation. A list of the documentation that comes with Perl. This list is useful for interactive learning along with this book.

Appendix G, ASCII Codes. A list of ASCII, hex, and decimal codes.

Appendix H, Special HTML Characters. A list of special characters, such as £, ®, and Æ. Although these aren't specific to Perl, you will probably need some of them sooner or later when generating HTML with Perl.

Other Resources

One of the best resources for Perl is the Perl documentation and the documentation included in various Perl modules. Chapter 1 covers how to read this documentation with the perldoc command. The Perl homepage at
is extremely useful with articles, tips, documentation, other resource links, and what's new in the world of Perl. The Perl Mongers" homepage at supplies good information on the world of Perl and Perl" advocacy. The use Perl Web site at is a community page where Perl information i" shared and discussed. The Perl Documentation Web site at is a very" useful site containing the latest Perl documentation. Finally, the Perl Monks at is another community where people can ask questions, answer questions, chat, and share knowledge.

Usenet has Perl newsgroups that are also useful: comp.lang.perl.announce has Perl announcements; comp.lang.perl.misc is a high traffic list for asking Perl-related questions; and comp.lang.perl.modules announces and discusses Perl modules. A non-Perl-specific news group that deals with CGI is comp.infosystems.www.authoring.cgi. Here you can discuss all topics CGI.

Contacting "

We would love to hear from you. You can find information on this book and errata at and


Reader review(s):

Head And Shoulder Above Most CGI Programming Books, July 19, 2002
There are a very large number of Perl CGI books in the shops. Unfortunately the number of good Perl CGI books is far smaller. I'm happy to report that this book is one of them.

The problem, of course, with most Perl CGI books is that they are written by people who just don't know very much Perl. That's certainly not the case here. Both Kevin and Brent are well-respected members of the Perl community and they know what they are talking about when it comes to writing CGI programs in Perl.

Another common mistake in Perl CGI books is that the authors try to take people who know a bit of HTML and teach them programming, Perl and CGI all at the same time. The authors of this book realise that this approach is likely to lead to, at best, patchy understanding of any of these concepts so they aim there book at people who are already programmers and who have some knowledge of Perl. This means that they can concentrate of teaching the parts of Perl that are useful when writing CGI programs.

One corner that is often cut when discussing CGI programming is security. This is a very dangerous approach to take as a badly written CGI program can leave your web server open to attack from anyone on the Internet. That's not a mistake that is made here as the authors introduce security in chapter 2. Add to that the fact that the code examples all use -w, use strict and and the book is already head and shoulders above most of its competition.

Early chapters look at common CGI requirements such as file uploads and cookies. Each chapter is full of well written (and well-explained) sample code. The example of an access counter in chapter 6 even locks the file containing the current count - this is possibly a first in a Perl CGI book!

By the middle of the book we have already moved beyond simple CGI programming and are looking at mod_perl. This chapter covers both the "faux-CGI" Apache::Registry module and also writing complete mod_perl handlers.

In the second half of the book we start to look at some bigger examples. The authors present a web-based email system and even a shopping cart. In order to fit these examples into their respective chapters a couple of corners have been cut, but there's enough information there to enable anyone to write the complete systems.

Chapter 13 introduces the HTML::Mason module as a way to separate content from presentation. It's obvious that the author's are big fans of this module and this leads to my only real criticism of the book. At no point do they mention the fact that the same benefits can be gained from using any of half a dozen templating systems found on the CPAN. I would have been a lot happier if they had mentioned things like Text::Template, HTML::Template and the Template Toolkit before picking HTML::Mason as the system for their example.

There are then two more long chapters with examples of a document management system and image manipulation software. Once more the code in these examples would serve as a greating starting point for anyone wanting to implement something along these lines. The last chapter looks at XML and, in particular, the use of RSS files to provide data feeds to other web sites.

All in all this is a very useful book for someone wanting to write web-based applications using Perl. It's packed full of good advice and code that follows all of the best practices for writing CGI programs in Perl. This book won't teach you Perl, but if you've read Learning Perl or Elements of Programming with Perl then you'll find this book easy enough to follow.

Effective and Unique, March 5, 2001
What a pleasure to find a book that succeeds in what it sets out to do. I wanted to improve my ability to write CGI applications with Perl and came away from this book with mission accomplished. As a bonus, the book contains uses for Perl I suspect many people don't know about.

The book uses a variety of methods to make its points--- interactive exercises, cut-and-paste code, extensive documentation, conceptual development, and plain English explanations and descriptions. Each chapter covers a CGI application. Concepts from one section become the foundation for practical, must-know applications covered elsewhere. Information is presented in logical order; chapter 4 doesn't expect you to know code from chapter 7. Truly valuable is the book's focus on "why it works" as well as the "how to do it." The "why" promotes a grasp of how to use a script or technique in other contexts. If you feel something special about that "oh yea, I get it" feeling, I think this book is for you.

I call the book unique because I haven't seen another with the variety of instructional methods, the "building-block" style, or the combination of practical skills with underlying knowledge.

In sum, the authors wrote an excellent book that I recommend to any serious Perl programmer or web designer.

The best CGI book in the store!, August 24, 2001
I'm not sure how they did it, but this book is incredible. It's not often that you find a book that can be used by a beginner and contains such intermediate/advance material. After a few chapters, I was able to finish applications that I had sitting around for months. The practical code and step-by-step explanations are great. The main text and code explanations employ the same concise, easy to understand teaching method. I am very impressed with the speed with which I was able to grasp and implement many new cgi concepts. Especially useful was the sections on using cookies, and the DBI interface. I already have 2 applications using MySQL and Oracle as a result of this book. Some projects that we were planning to implement using java and an expensive proprietary java web server and now being done in cgi, thanks to the sections on, mod_perl and Apache::Registry. Finally, I had plan to use a companion Orielly perl book to bring me up to speed on my perl, but there was little need since the authors did such an excellent job with explaining the perl concepts, code and cgi.

Excellent intermediate level Perl CGI book, April 9, 2001
At last, a Perl CGI book that doesn't spend the first two chapters showing you how to install Active Perl on Windows 98!

This book is for those who have already started working with Perl CGI and want to know more. If you have ever downloaded and installed scripts from Matt's Script Archive or or if you have installed Perl on your Windoze box and played with it and want to learn more, this book is for you.

Unlike many Perl CGI books that end with a chapter on how to use modules from CPAN, this book with starts with how to install and use modules and then shows you how to use the more advanced Perl CGI features like, mod_perl and Mason. It takes you through projects like using the Perl DBI, file uploading, cookies, working with the Apache registry and XML.

As an earlier reviewer pointed out, this is a unique Perl book and has its own niche. If falls in between a beginner book like Jacqueline Hamilton's CGI Programming 101, Simon Cozen's Beginning Perl or Randall Schwartz's Learning Perl and the more advanced books like O'Reilly's Programming Perl and Advanced Perl Programming.

It's also nice to see a new Perl CGI book come out a time when CGI seems to be losing ground to the newer web development technologies like PHP, Java Server Pages and ASP.

Endlessly Practical Examples!, May 4, 2002
This book is just great. Clearly written by two authors that have spent some time doing some real work out there in the real world, you'll NEVER find any overly academic examples in here. They just go from one very useful example to another. They teach you how to use CGI programs with MySQL databases, how to process all manner of forms, use dynamic image manipulation via CGI modules, handle file uploading, handle cookies, etc. Plus, the examples they give are all made from the point of view of using CGI in a real-world, website environment. You can take the code they give you and add it in your own programs with no difficulty whatsoever.

This is a great book of useful, real-world CGI examples. As long as you already know Perl (you must have a decent familiarity with the language and some scripting background to really use this book well, or else you will get overwhelmed!!!) this is a perfect way to go from theory to practice in just a few easy steps.

Finally a CGI book that pays enough attention to security!, August 28, 2001
When I first got this book, I thought "CGI is a much more complex standard than this! For example, what about all the strange things you can do with hidden form variables?" Then in occurred to me that the unifying theme of this book is not "everything you can do with CGI" -- it's "everything you can do with CGI, done SECURELY".

All the various CGI tricks I'd known and used that weren't mentioned in this book, were the sort of thing that a beginning programmer might misuse, and thereby accidentally create a way for some malicious user to, for example, delete or corrupt any file on the filesystem, or order any product for [price]. Since /most/ beginning programmers create programs with just those kind of accidental security problems, I'm glad that this book sees security as a primary goal.

In other words: they show you how to do anything you need in CGI, but they don't give you enough rope to hang yourself with! The other thing that makes me happy with this book is that it wisely takes the (very realistic) perspective that CGIs are programs that have to do something /besides/ just talking to the Web browser -- they have to access a database, send a piece of mail, read from a config file, write to a log file, or whatever other details the task demands. That's just the way the CGI business is, and this book gives you a nice introduction to that way of programming.

I heartily recommend this book for anyone who's starting out doing CGI programming. It assumes you do know some Perl already. If you don't, and you already have a strong programming background in some other language than Perl, can probably just make do with the Perl man pages; but less experienced folks should get /Learning Perl/, or /Elements of Programming with Perl/, or maybe even /Teach Yourself Perl in 24 Hours/ (which has a good CGI section, incidentally).

One note: currently this book is in its first printing, so there are, as always, typos. The errata list at was quite helpful.

This is a good book, June 18, 2001
I purchased this book about a week ago and I must say I am impressed. Finally, a CGI reference that serious Perl programmers can use.

Pick this up, along with Lincoln Stein's "Official Guide to Programming with, and you will be well on your way to Perl/CGI Nirvana.

I was disapointed to see the negative review posted about this book. This is not a book that teaches Perl. Rather, it teaches the user how to use Perl to develop CGI apps. I think THAT reviewer would be better off with the excellent "Learning Perl" from O'Reilly. The level of Perl knowledge needed to understand this book is not very high, however. A moderately experienced developer will breeze through the examples.

Good luck!

Excellent text on the subject, June 17, 2001
This book covered everything that I wanted to learn about doing CGI with Perl. It is well-written and very easy to read. All of the example code is described in a line by line fashion, and it's described well enough that even those with only basic Perl knowledge will understand. It promotes good programming practices, and the authors share many topics and techniques that even those already familiar with CGI will learn from. It's a great book!

Just an awsome book - chock full of useful web code, April 2, 2003
I just started using this book and it is friggin' amazing. I've been a fan of Perl for years although I've also programmed in VB, C, Java, etc. But Perl has always been the "useful glue" for everything. Most of my web dev has been Java and just starting to tap Perl as a CGI solution. This book has educated me more in ONE HOUR than I even imagined. It expects that you have used Perl a bit, but not much. It really reveals the power of Perl as a CGI/server-side solution. I always think books this well done are worth buying since you'll just get smarter and make more money - a no brainer.... HIGHLY RECOMMENDED.

A Great Buy, June 24, 2002
Worth the price for a Beginner to intermediate level

Not all I expected, November 18, 2003
I read the raving previous reviews and thought this would be the CGI book for me. It wasn't. I know a bit of perl, but relatively little about cgi (I know a bit, but not much). Here are my comments:

Good things:
- I thought most of the example programs in the text were good and illustrated the points being made.
- I liked the discussion on taint

Bad points:
- I thought the examples were somewhat random and did not give me tools to attack general problems.
- I would have liked a better description of (perhaps I should get Lincoln Stein's book)
- I did not like the line by line format of the code. I found this very distracting and redundant. I would have preferred seeing the code and then having the authors describe the main points of the code (instead of all the trivial comments inbetween all the lines).
- I did not like the dependence on databases. Perhaps this is something most serious cgi programmers use, but storing my data in text files is sufficient for most of the applications I might use. I would have preferred a separate chapter on database and cgi (or I could just buy a separate book on this).

I'm not sure why everyone else raved about the book so much, but I didn't find it so wonderful.

Not a good introduction to CGI, June 18, 2004
I bought this book because the Amazon reviewers loved it so much. I got about 150 pages into it and now I need to buy a different book. This book is good for people who really really like to learn by rote. The authors cover interesting and important topics, but they don't explain them well. They don't even try to outline the purpose of a script before coding it. They also introduce functions that are new to the reader somewhere in the middle of a script. They never write, "This is function x. It can be used like this... Here is an example...."

They just start coding without any introduction except for some stupid jokes.

That said, if you already know a buttload of Perl and DBI and CGI programming, you might like this book for the examples.

Also, there were way too many errors in the text and the code, and that makes it even harder to learn.

Very helpful, April 9, 2003
This is an extremely useful book for writing web-based applications with Perl. Lots of helpful descriptions and examples. Useful for beginners to familiarize themselves with a wide range of necessary terms and topics. For example, I found the chapters on mod_perl and dbi very helpful. Also useful for more experienced CGI programmers because of the useful examples and techniques presented.

A Must-Have book for writing CGI applications, March 16, 2002
I needed a book to both learn the details of using the CGI Perl module, and also as a reference guide. This book does both admirably. Kevin and Brent cover a lot of material and back it up with real world examples of how to do it, as well as providing a detailed explanation of why and how it works.

Effective and Unique, March 5, 2001
What a pleasure to find a book that succeeds in what it sets out to do. I wanted to improve my ability to write CGI applications with Perl and came away from this book with mission accomplished. As a bonus, the book contains uses for Perl I suspect many people don't know about.

The book uses a variety of methods to make its points--- interactive exercises, cut-and-paste code, extensive documentation, conceptual development, and plain English explanations and descriptions. Each chapter covers a CGI application. Concepts from one section become the foundation for practical, must-know applications covered elsewhere. Information is presented in logical order; chapter 4 doesn't presume you know something covered in chapter 7. Truly valuable is the book's focus on "why it works" as well as the "how to do it." The "why" promotes a grasp of how to use a script or technique in other contexts. If you feel something special about that "oh yea, I get it" feeling, I think this book is for you.

I call the book unique because I haven't seen another with the variety of instructional methods, the "building-block" style, or the combination of practical skills with underlying knowledge.

In sum, the authors wrote an excellent book that I recommend to any serious Perl programmer or web designer.

{end of page}

(Page code from the SEO Tools, Toys, and Packages site)