Oakland.pm

Reviews

Review of "Beginning Perl"

authors: James Lee with Simon Cozens and Peter Wainwright

reviewer: George Woolley

Beginning Perl cover image

Beginning Perl, Second Edition
By James Lee
ISBN: 1-59059-391-X, 464 pp.
Published: Aug 2004, Price: $39.99

Note

Short Review

A Very Good Book. :) :) :) :) of 5.

This book is a well-conceived introduction to Perl in tutorial form. It covers the basics of the Perl language and also the basics of some more advanced aspects of Perl, e.g. object-oriented Perl.

If you want to learn Perl and you like a tutorial approach, this would be a good book for you. If you teach Perl, I suggest getting hold of this book and pondering the approach used.

For more detail, see my Somewhat Longer Review.

George Woolley of Camelot.pm and Oakland.pm

Miscellaneous

Chapter Titles

  1. First Steps in Perl
  2. Scalars
  3. Control Flow Constructs
  4. Lists and Arrays
  5. Hashes
  6. Subroutines/Functions
  7. Regular Expressions
  8. Files and Data
  9. String Processing
  10. Interfacing to the Operating System
  11. References
  12. Object Oriented Perl
  13. Modules
  14. Introduction to CGI
  15. Perl and DBI

Online Watch

Silly

I learned in this book that the Babylonians used a base 60 numbering system. Eat your heart out.

Base 60 is easy; to start with, just imagine you have 60 fingers.

For an artist's view of the place of the Babylonian number system in the history of mathematics, see the 2004-02-01 "Byte Me" comic. (And if you were wondering, yes, that Steve Fink!)

Perldoc

Perldoc provides basic information about the Perl language. You can use perldoc from a command line prompt. Below are several examples of this from the book:

  • perldoc perl
  • perldoc -f print
  • perldoc -q reverse
  • perldoc Text::Wrap
  • perldoc perlfunc
  • perldoc perlmodlib
  • perldoc perlobj
  • perldoc perlvar

Request for Feedback

Let me know at george in the domain of metaart.org if you feel that:

  • I am wrong in general or in particular.
  • Something is poorly stated.
  • etc.

Thanks for considering giving feedback.

Somewhat Longer Review

Contents

Beginning Perl cover image

Note:

  • Click on the cover image above to go to the Apress catalog entry for the book being reviewed here.

The Cover

"Beginning" in the Title: I take Beginning here to imply that the book is suitable for beginners at Perl, that is, people who know little or no Perl. The book claims to be an appropriate one for such beginners to use to learn Perl.

"Perl" in the Title: Well, hopefully you already know what Perl refers to. But just in case here's some characterizations of Perl:

  • Perl is a programming language.
  • Perl can stand for "Practical Extraction and Reporting Language".
  • Perl is widely used for writing CGIs, for system administration, and for all manner of text processing.
  • Perl has the moto TMTOWTDI (i.e., "There's More Than One Way To Do It"); and, indeed, Perl often does provide many ways to do the same thing.
  • Perl runs on most OSs you are likely to encounter.

Other Text: There's two chunks of text on the cover (of my copy) that qualify the title:

  • "Master key Perl concepts such as CGI programming, databasing, and object-oriented programming with this comprehensive guide"
  • "SECOND EDITION"

In this context, I take comprehensive to mean "amply broad" (amply broad for a beginner, that is).

A Fitting Cover: The book is, indeed, suitable for people who don't know Perl but want to learn it. And there are chapters to introduce the reader to: CGI programming in Perl, object oriented programming in Perl and data base programming in Perl. So, yes, the book generally fits the cover.

Since I haven't read the first edition, I have no comment on whether or how much the second edition improves on the first.

About the Reviewer

The purpose of this section is to give some perspective, as best I can, on where I'm coming from in this review. Hopefully, that will help you in your consideration of this review.

Perl: Here goes:

  • I've been using Perl since 1994.
  • Perl is easily my favorite programming language
  • I'm not an expert at Perl.
  • I am an advocate of Perl.

I've used Perl the most in Linux/Unix environments. :) I've also used it a fair amount on an old Mac OS system and a small amount on Mac OS X. :) I've never used Perl on Windows. :(

Training: I have considerable experience developing self-teach materials for Unix, including for C and C++ (but not for Perl). I also have a bit of experience teaching in a Unix context including introductory Perl. And I want people to learn Perl.

So I am oriented toward and somewhat aware of teaching and learning. This may be helpful in reviewing a book which is especially for beginners.

I'm big on people learning to do things for themselves, including learning Perl. This is partly based on the "teach a man to fish ..." thought.

Relational Data Bases: I have only a little experience with relational data bases. And I've never used the Perl DBI module. So I have little to say about Chapter 15 which is focussed on those two subjects.

Editions: The book being reviewed is the second edition. I have not read, nor even looked through, the first edition of this book.

Examples and Exercises: I read all the example programs (in the bodies of the various chapters) and I created and ran all of them for the first ten chapters. However, I created and ran only a few of them for the last five chapters.

I read all the exercises (at the ends of chapters) and thought of how I would approach each one. However, I didn't create and run many of the suggested programs.

What You Get

Front Matter: The most important part of the Front Matter is the Introduction. The Introduction includes such things as

  • a brief history of Perl
  • a brief description of Perl 6, which is
    • under development
    • a version of Perl
    • the Perl community's rewrite of Perl
    • a major change from previous versions of Perl
  • how to get hold of Perl
  • where to go for more information
  • how the book is organized
  • why to learn Perl

Basic Perl: The first 10 chapters are basically a tutorial on what I consider the basics of the Perl language. See under Chapters in the left column.

A typical chapter consists of:

  • an introduction to the chapter that gives you a preview of the chapter
  • a number of sections that explain key concepts or how to use various structures or features of the Perl language
  • a chapter summary that sums up and illuminates the chapter
  • several exercises that reinforce some of the things learned in the chapter

The author often uses examples to make his points. Occasionally there's a flow chart or other graphic. Both the examples and the graphics are very clear.

Advanced Topics: The last five chapters tackle five more-advanced topics, one in each chapter. Again, see under Chapters in the left column.

The description above of a typical chapter applies to these chapters too.

Back Matter: The Back Material consists of

  • solutions for the exercises in each chapter
  • an index

What I Like

Context: In the Introduction to the book, the author gives a good summary of:

  • the history of Perl
  • the rationale for Perl
  • the future of Perl
  • and more

Structure: I like the way the book is organized. The sequence of chapters generally makes sense to me, and each chapter is coherent, digestible and of moderate length (The longest chapter is 40 pages).

Lightness: The book from time to time is light, sometimes even humorous. This, in my view, is helpful to someone trying to learn a new language.

Tools for Learning Perl: The book does a good job of providing the reader with tools for continuing to learn Perl. Three areas in which the author does this are discussed briefly below.

Perldoc is introduced in the introduction of the book, and the reader is shown how to get information on:

  • basic info about the Perl language
  • specific functions
  • specific modules
  • and more

The body of the book reinforces the use of Perldoc by using it several times.

I particularly like the example programs in the book. They do a good job of illustrating what is being addressed. And the author encourages the reader to do his or her own "empirical research" which he or she should be able to do, having been given such a good model.

The author includes valuable links for further learning, e.g. to

  • Perl.org: a good default place to start for all things related to Perl
  • Perl Mongers: a loose association of Perl user groups from all over the world; a good place to start a search for a Perl group near you
  • CPAN: Comprehensive Perl Archive Network; a repository of Perl modules, scripts, documentation and more
  • Perl Monks: an online role played monastery where actual dedicated Perl users really do seek to become better Perl programmers; a good place to get difficult questions answered

Gripes

Mastery: The cover suggests that using this book you'll be able to master certain key concepts. (See The Cover above.) I doubt it, though you do get a good introduction to these concepts, which is what's appropriate for a book aimed at beginners.

Tools for Learning Perl: This book does provide a number of things to enhance the reader's ability to learn Perl. I think the book could do way more in this area, but then I always do.

Perl's Expressive Power: The author does a good job introducing the reader to things that make Perl powerful, but I believe he does less well at communicating the power inherent in what the reader has learned.

Index: The index seems pretty good. However, when I was writing this review, it failed me several times.

I don't see any entry at all for array, length or for Perl 6, though both are discussed. The book includes a number of passages relevant to TMTOWTDI (the perl moto), but only one entry under TMTOWTDI in the index; the quite useful initial discussion of TMTOWTDI (in the introduction) is not referenced under TMTOWTDI.

Who's the Book for?

The introduction of the book has a section entitled "Who This Book Is For". My understanding is that it's intended for Programmers (novice or experienced) who want to:

  • learn Perl
  • be introduced to its power

Learning Perl: This book would be a good choice for a novice programmer who wanted to learn Perl.

More experienced programmers may feel the tutorial approach slows them down too much.

Learning of Perl's Power: Hm, what kind of power? The book doesn't say, but I would guess mostly expressive power.

Some of the more important things that make Perl expressively powerful are:

  • hashes
  • to kill for regular expressions
  • modules
  • Perl's object oriented capability
  • TMTOWTDI even for very simple things. For example, there are many ways to quote a string, with some quite useful variations in semantics. For example, you can equally easily write object oriented or procedural code in Perl depending on the problem, etc.

The book has a chapter on each of the first four of these. The book touches on the fifth item too.

Teaching Perl: The book doesn't claim to be aimed at teachers of Perl. But I think people who teach Perl will likely find the approach provocative.

Final Thought

This book is a well-conceived introduction to Perl in tutorial form covering the basics of Perl and also covering the basics of some more-advanced areas of Perl.

I particularly recommend this book for the consideration of

  • novice progammer's wanting to learn Perl
  • teachers of Perl

Beginning Perl cover image

Completed: 2004-10-15a