Mastering Perl/Tk: A Book Review
Title: Mastering Perl/TkAuthors: Steve Lidie and Nancy WalshPublisher: O'ReillyISBN: 1-56592-716-8
Until January of 2002, programmers wanting a book on Perl/Tk had one option: Learning Perl/Tk, by Nancy Walsh. Although well researched and accurate, it gave the reader only a basic familiarity with what Perl/Tk could do. Many readers wanted more, expressing the desire for a new book that contained more detailed examples, coverage of composite widgets and more detailed reference materials. To address these desires Nancy wrote Mastering Perl/Tk, this time enlisting the help of Steve Lidie, author of the Perl/Tk Pocket Reference.
The book's stated purpose is to be the master reference on Perl/Tk. It is written to be usable by someone having only basic familiarity with Perl programming, but it also covers the most advanced features of both Perl and the Tk module, so as to make the dedicated reader of this book a master of GUI programming with Perl/Tk.
I believe the book meets these goals and, apparently, so do Perl/Tk programmers who shop at Amazon.com: Learning Perl/Tk is now selling at 50% of its $34.95 price, while Mastering Perl/Tk is commanding 70% of its $44.95 list price. For better or worse, Mastering Perl/Tk is likely to be the death knell of its forerunner.
Mastering Perl/Tk is divided into two distinct sections. The first half of the book (chapters 1-13) covers the same material found in Learning Perl/Tk; in fact, several of the examples and text sections are repeated verbatim. The difference in Mastering Perl/Tk is that the material is presented in a manner appropriate to a more experienced audience. Critics of Learning Perl/Tk accused the author of "handholding", and she has tailored Mastering Perl/Tk accordingly.
The reader will have a fully functional GUI program running by page 12. By the end of chapter 13, the reader will have gained experience with all the stock widgets in the Perl/Tk module. The book also covers deployment of Perl/Tk on both UNIX and Windows platforms.
The authors devote chapters 14 - 23 to advanced material not previously published. Building custom widgets, operation of the Perl/Tk MainLoop function, images and animation, and interprocess communication each have a full chapter devoted to them, as do widget writing in C and using the LWP module for web access. Chapter 23 covers some miscellaneous topics like the NoteBook and Dialog widgets and cursor manipulation. Finally, three appendices present how to install Perl/Tk (on UNIX and Windows platforms), options and defaults for all stock widgets and source code for examples in the second half of the book.
I particularly liked the level that at which this book is written. I have several years experience with Perl programming in general, though I have never done it professionally or full time. However, I was able to understand all the material in the book without referring to any outside references. Concepts are explained in detail, but without overkill (read: handholding). The code examples are written in a nearly self-documenting style.
The authors are able to impart their considerable programming and software design experience to the reader, so that one gets an idea of not only how to code a program but where and why Perl/Tk would be a good language for writing a Windows-based application.
O'Reilly's web site has two errata files for this book. The errors listed amount to four trivial typos and four page number errors in the index. As for glaring errors and conceptual inaccuracies, there are none.
I personally think a relational database example would have been a valuable addition to the book. However, other examples cover general data formatting in enough detail that developing a GUI database application should not be difficult, if one understands all the material in the book.
It is possible to learn Perl/Tk using only material that is freely available on the Internet. However, Mastering Perl/Tk is truly a value-add above and beyond on-line reference material. The authors' explanations and examples give you ideas on how to build useful applications that solve real problems. The on-line material tells little more than syntax.
If you want to learn more about GUI programming in Perl, Mastering Perl/Tk will be a valuable addition to your library.
Bill Cunningham is a Systems Engineer with Reuters America, Inc. He is based in Charlotte, NC. His interests include just about anything to do with Perl and UNIX.