Learning Perl/Tk

September 1st, 1999 by Bill Cunningham in

This book is targeted for those just beginning windows programming in Perl/Tk on both UNIX and Windows platforms, although veteran programmers will find a wealth of detailed information in it as well.
Your rating: None Average: 4.7 (3 votes)
  • Author: Nancy Walsh

  • Publisher: O'Reilly & Associates

  • E-mail: info@ora.com

  • URL: http://www.ora.com/

  • Price: $32.95 US

  • ISBN: 1-56592-314-6

  • Reviewed by: Bill W. Cunningham

Learning Perl/Tk, by Nancy Walsh, is the first of what will undoubtedly be many books on this subject, and it will be a tough act to follow. This book is targeted for those just beginning windows programming in Perl/Tk on both UNIX and Windows platforms, although veteran programmers will find a wealth of detailed information in it as well.

Learning Perl/Tk is well-written and thoroughly researched. It begins with a brief history of the Perl and Tk languages. It tells exactly where to download the Perl/Tk module, how to unpack and install it, and how to test your installation to see if you are ready to write Perl/Tk programs.

Next is a general discourse on window geometry, and the concepts of the widget and the event loop. These are details the windows programmer must deal with that do not apply to the traditional Perl programmer. Ms. Walsh does a fine job of explaining these concepts in terms anyone can understand.

The majority of the book is devoted to a detailed description of the most commonly used window widgets: the button, check box, radio button, label, entry, scrollbar, list box, text box, canvas, scale, menu, frame and composite widgets such as the dialog box. Virtually every aspect pertaining to these widgets is covered in the minutest detail: color, placement, size, border size, style and functionality. Other widgets are available in Perl/Tk, but these are the most common ones, and in order not to get too far out in left field, the book limits its focus to these.

The author's code examples are written in an elegant, concise, easy-to-follow style. For example, the following code creates five text entry widgets, each in a different relief style, with the style's name displayed in the respective boxes:

foreach (qw/flat groove raised ridge sunken/) {
$e = $mw->Entry(-relief=> $_)->pack(-expand=> 1);
$e->insert('end', $_);
      }

This example appears on page 112 of the book. Throughout, the author demonstrates an enviable command of the Perl language, particularly the object-oriented features.

The book does a great job of bringing the first-time Perl/Tk user up to speed. By the end of the second chapter, the reader will have at least five fully-functional windows programs up and running. And for the veteran programmer, the book goes into a level of detail about the various window widgets which should meet the most demanding needs.

There is something of a void of information for the intermediate-level programmer. For example, there is no discussion of how to create a text-entry widget, get some user input from the widget, and use Perl to do something useful with the input. The Perl/Tk module does come with many demo examples that basically fill this gap. I did notice a few minor typos in the book, but it was obvious even to me (a non-programmer) how to fix them. Almost all the code runs perfectly. I know, because I typed in and ran each example! Virtuous (i.e., lazy) programmers can download all the book's code from the O'Reilly web site (http://www.oreilly.com/catalog/lperltk/).

Learning Perl/Tk provides a simple yet thorough introduction to this newest method of writing windows programs, and will also be a valuable reference for the production programmer. There is room for more books on this subject at the intermediate level.

I believe anyone with an interest in Perl/Tk will benefit from reading this book, and I recommend it with enthusiasm.

Bill W. Cunningham, Gunnery Sergeant in the U.S. Marine Corps, is a system administrator with the Second Marine Aircraft Wing, G-7, Cherry Point, NC (the greatest job in the universe). He likes playing guitar, reading, driving and spending as much time as possible with his wife and four kids. He can be reached at bwc@coastalnet.com.

__________________________


Special Magazine Offer -- Free Gift with Subscription
Receive a free digital copy of Linux Journal's System Administration Special Edition as well as instant online access to current and past issues. CLICK HERE for offer

Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.

Post new comment

Please note that comments may not appear immediately, so there is no need to repost your comment.
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd> <i> <b>
  • Lines and paragraphs break automatically.

More information about formatting options

Newsletter

Each week Linux Journal editors will tell you what's hot in the world of Linux. You will receive late breaking news, technical tips and tricks, and links to in-depth stories featured on www.linuxjournal.com.
Sign up for our Email Newsletter

Tech Tip Videos

From the Magazine

December 2009, #188

If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.







Read this issue