Perl Annotated Archives

January 1st, 2000 by Paul Dunne in

The book is full of clearly explained code.
Your rating: None
  • Author: Martin Brown

  • Publisher: Osborne/McGraw-Hill

  • E-Mail: customer_service@mcgraw-hill.com

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

  • Price: $49.99 US

  • ISBN: 0-07-882557-1

  • Reviewer: Paul Dunne

This is a fine book and a good resource for learning Perl. The subtitle, “Code with Commentary”, is apt. The book is full of clearly explained code. Studying such annotated examples of practical code is an ideal way to learn a language or increase one's knowledge of a language. The author takes a cross-platform approach, which is nice to see. Even though most of the examples are inevitably UNIX-based, some code is also demonstrated for fixing NT and Macintosh problems. The usual CD with code examples is included. One minor annoyance is the lines are terminated with “CRLF”, but I suppose it's easier for Linuxers to deal with this than for those using NT to handle bare newlines.

The book is divided into four parts. It begins with “Text Processing”, which also serves as a basic introduction to Perl. This section starts by rounding up the usual filters, then examines simple file manipulating, and concludes with various types of text database work. After that, “Networking and E-mail” does a good job of illustrating and explaining Perl's excellent support for network programming. Part 3, “World Wide Web”, covers the ground one would expect: HTML munging and CGI scripts. The CGI coverage ranges from simple examples to an entire on-line shopping application. Finally, “Administrator's Toolkit” supplies a useful set of tools for systems and network administration. All in all, 11 chapters, with over a hundred clearly and closely explained scripts—there is nothing I can find fault with here.

I have one issue to raise, however. That is, “everything with Perl” is not always the best way. While one can hardly fault a book about Perl for taking this approach, I would still like to see more emphasis on how Perl can co-operate with existing UNIX utilities. For example, my ISP uses dynamic IP addressing, so when I need to find out what my IP address is this time, I use a little shell script that reads as follows:

ifconfig | grep ppp -A1 | domain.pl | head -1

Where domain.pl is the following script:

#!/usr/bin/perl -n
while (m/(([-a-zA-Z0-9]+\.[-a-zA-Z0-9]+)(\.[-a-zA-Z0-9]+)*)/g) {
    print "$1\n";
}
I know this doesn't cover all cases, but it works where required. I guess I could have implemented the whole pipeline in Perl; but for me, and I suspect many other UNIX users, it is easier just to bolt a few tools together than to write a program, even in a language as easy to get started in as Perl. Why reinvent the wheel? Much better to use Perl as part of the UNIX toolkit, not to replace it.

In conclusion, as Perl is best-known as the “glue” that holds many web sites together, this book, if aimed at any specific audience beyond Perl learners and users, it is aimed at the web site administrator or programmer. However, it is well worth reading by anyone interested in Perl.

Paul Dunne (paul@dunne.ie.eu.org) is an Irish writer and consultant who specializes in Linux. The only deadline he has ever met was the one for his very first article. His home page is at http://www.cix.co.uk/~dunnp/.

__________________________


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.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
enigma sadeness mp3's picture

linux

On October 2nd, 2007 enigma sadeness mp3 (not verified) says:

magic there in Is to I rescan that /proc/scsi SCSI any the use bus? can . Bye.

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

Featured Videos

Setting up an https server in Apache is easy. This tutorial covers how to create and sign your ssl certificate as well as how to configure the web server.

From the Magazine

January 2009, #177

It's a battle as old as time: good vs. evil. Fortunately, Linux and FOSS are on our side as we wage the battle against those who try to steal our secrets and invade our systems.

Checking your system's security is best done sooner rather than later. Test the locks with our article on security verification; find out how to use PAM to help secure your systems; use MinorFS and AppArmor to implement discretionary access control; learn more about Samba security in part III of our series; use Darknet to help detect bots and secure your systems; use the Yubikey to increase your site's security; and don't forget to lock the doors, because a cold boot attack could render your security useless if somebody has physical access to your computer.

But, we're not just about sowing the seeds of fear. We also show you how to use memcached in Rails, how to manage multiple servers efficiently, how to deploy applications easily with Capistrano, how to manage your videos with MythVideo, how to mix it up a bit (your audio that is), and even play a few games.

Read this issue