My Review of Learning Perl, 5th Edition

Originally submitted at O’Reilly

Making Easy Things Easy and Hard Things Possible


Great intro to Perl

By Jim Schubert from Richmond, VA on 2/18/2012

 

5out of 5

Pros: Helpful examples, Easy to understand, Concise, Well-written, Accurate

Best Uses: Novice, Student

Describe Yourself: Software Engineer

I picked up this book on a whim to learn Perl. I was extremely impressed, especially by the three chapters on Regular Expressions.

If you have used Perl, this book may be fairly basic. There are whole chapters on Scalars, Arrays, Hashes, etc. I have a lot of experience in a lot of languages and technologies, and I can tell you this book is well-written and well-organized to ease you into the Perl mindset.

First of all, most languages are like mathematics. 1+1=2 is a rule. If that rule didn’t work, math wouldn’t work. Similarly, ‘int x = 1;’ in C-style languages will always point the variable ‘x’ to the memory location storing the value of ‘1’. Rules are rules. However, Perl is contextual. When you do one thing in Perl, you may have a different result depending on the context of the code. For example (extremely-generalized example), hashes can be considered an array of values in which every even index is the key and every odd index is the value. So, an array of [“first”, “1st”, “second”, “2nd” ] could easily become a hash with the keys and values related as expected. Weird? Yes. Basic, not really. I think that can be a very difficult concept for a lot of people… too meta.

The book does a great job of easing a lot of the Perl concepts onto the reader. Interestingly, the part of the book I found the most useful are the three Regular Expressions chapters. I have recommended this book to students in the past solely for the three Regular Expressions chapters. They are clearly and concisely written in a way that presents the Perl syntax very well.

If you’re familiar with Perl already, this book probably isn’t for you. You would probably be better off with the Intermediate Perl book also available by O’Reilly. Even after reading both books and working a bit with the Catalyst framework, I found myself coming back to the last chapter of this book to fully understand eval blocks.

(legalese)