Book Reviews

The following book reviews are the copyright of their respective authors and no part should be reproduced without the express permission of the author. Publishers and Authors of the books reviewed may reproduce the whole or extracts of a review for their book. To request copyright permission please email webmaster@birmingham.pm.org.

All the reviews herein are the opinions of the reviewer and are not necessarily the views of Birmingham Perl Mongers and its members. If you feel a review or comment has been made in error, please contact webmaster@birmingham.pm.org to rectify the situation.

Perl Books

Static Link: http://birmingham.pm.org/reviews/1

 
Perl Debugger (Pocket Reference)
Title:Perl Debugger (Pocket Reference)
Author(s):Richard Foley
ISBN:0-596-00503-2
Publisher:O'Reilly Media
Reviewer:Barbie

Compared to other Pocket Reference guides I've read, this weighs in a little hefty. However, that only goes to show there is a ton of stuff you should know about the Perl Debugger. Although only a Pocket Reference, there isn't much that the book doesn't cover, and suits a smaller style better than a more meatier tome.

We begin with a few introductions and conventions, together with the script that is used throughout the examples. Before starting to debug, some worthwhile words of wisdom are dispersed, such as 'perl -c script.pl', 'use strict', 'use warnings', 'use diagnostics' and taint mode. The debugger should be used properly. Perl has several methods to help you spot problems with your code, using them first may make using the debugger redundant or at least a little easier.

A simple Debugger Tutorial then follows, including a CGI session. It introduces some of the basic commands, which help you print and dump variables, list lines of code, step through code and quit. In a few cases this might be all you need to do to spot the problem, but most likely you'll be want to set breakpoints and watchpoints, view the stack and much much more. The Debugger Commands section lists all you need to know, with concise and helpful explanations and examples.

The section Debugger Variables, shows you how to access configuration settings within the Perl Debugger itself. These are most useful when you want to set default breakpoints in your code, to save you time getting to the required line in the interactive session. There are several others too. The nice thing is that as these variables are only available during a debugger session, you can leave them in production code with no fear breaking anything.

Environment Variables allow you to override several default settings, including the default debugger itself, if you decide to write your own. There are many Debugging Options, which help with dumping results to file, setting depths for printing arrays, window listing size, among many other useful options.

The next section looks at some useful modules within the DB:: and Devel:: namespaces, which can be incorporated into the debugging experience. I also noted that Acme::Bleach and Symbol::Approx::Sub both get a mention here. All I can say is the author obviously has a sense of humour :)

There are several references to other materials, whether as part of your installation (perldoc, perdubug, etc), printed matter or online resources and articles. There is a quick look at some of the other debuggers, IDEs and Text Editors with debugging support available, which then rounds off this section.

The final section of the book is a simple two page Quick Reference guide, with all the most common commands you are likely to use.

There are few hash representation mistakes I spotted, but checking the errata page, I see they've already been spotted. But then I guess if you're following the book, they are fairly obvious printing errors, and don't detract from the book as a whole.

This about as comprehensive book as you need to use the Perl Debugger, and well worth the cover price. Though you might not need it all the time, it certainly earns its place in every Perl programmers kitbag.

- Barbie, March 2004