Learning Perl

When the 4th edition of Learning Perl came out, I was curious to see what had changed between the covers of the "Llama book." A couple of years ago, I was pretty sure that, by the time a new edition of the Llama book was at my local bookstore, it would be covering Perl 6. Since Perl 6 is still in development, it looks like we'll have to wait until the next edition (and, one hopes, no longer!) to see Learning Perl take it on. In addition to reading through Learning Perl, I also had a chance to have a short chat with two of the book's authors, Randal L. Schwartz (who also writes Linux Magazine's "Perl of Wisdom" column) and brian d foy. Schwartz and brian also do Perl training and consulting through Stonehenge Consulting Services (no relation).

So, what’s changed in the Fourth edition? Well, quite a bit. The text has been updated to cover Perl 5.8, and a few chapters have been removed since the third edition. While thumbing through the 4th edition, I compared it to my dog-eared copy of the 2nd edition, and noticed that chapters on CGI programming and DBM had been removed. In their place, we have chapters on Perl modules and “advanced” techniques. Should people who own earlier versions of Learning Perl buy this edition? Well, as brian pointed out, “if you bought the last edition, you’ve already learned Perl.” Theoretically, anyway.

One thing I was curious about, is whether the popularity of Perl is waning in any way. A lot has been written about the popularity of PHP, Python, Ruby and other languages, and some may get the impression that Perl has become less popular while languages like PHP become more popular. This may be more perception than reality, however. Schwartz pointed out that he’s noticed that one leading indicator, listings for Perl jobs, have actually been on the increase, and that he’s not “nervous about the popularity of Perl.”

When I asked brian if he thought that the popularity of Perl was waning, he noted that “everywhere we [Stonehenge] go, people use Perl.” (Though it may be that they’re going where people use Perl.)

What may be contributing to the impression that Perl is less popular is the fact that Perl is getting on in years. According to brian, “people just assume that you’re going to use it. No one talks about the death of C or the death of Unix, they just assume it’s something that you’re going to use.”

However, brian said that Allison Randal told him that there was a “big spike” in the Perl book market over the summer, because O’Reilly had published several new books on Perl. “Perhaps part of the unsexyness was that no one was putting anything new out there in Perl.” This is interesting to note after Tim O’Reilly said in July that “if book sales are any indicator, PHP is twice as popular as Perl.”

Of course, Perl stands to get a great deal of attention when Perl 6 is released. I asked Schwartz if he’d been involved with the development of Perl 6. Schwartz said, “I keep my ear to the ground…make comments where I can” but that he wasn’t greatly involved in Perl 6 development.

I asked if it seemed like Perl 6 was taking too long. Schwartz pointed out that, though it may seem like Perl 6 is taking a really long time, “it’s really not much longer than what Perl 5 took, but people forget this is a radical effort.” He also compared the Perl 6 development process as “equivalent to the work that Apple went through for 68k to PPC” and that it was important that it be done right.

Despite the fact that a lot is changing, a lot is remaining the same as well. Schwartz noted that the documentation, and press, is focusing on what’s changing. That’s natural, of course — people are interested in the differences between what they know now and what Perl 6 will be — but a lot of Perl will remain the same.

Don’t be nervous about learning Perl 5, however. First of all, it will still be a while before Perl 6 hits the streets. Even when it does, Perl 5 won’t be going away as soon as Perl 6 is available. It’s been noted many times that it took a long time for people to switch from Perl 4 to Perl 5, and there is a lot of vital code written in Perl 5, which brian pointed out, “one of the first design considerations [with Perl 6]…whatever we come up with, should run 95 percent of the Perl 5 programs without any changes.” He also said that Perl 5 would be maintained after the release of Perl 6.

For those who don’t already know Perl, I’d recommend picking up the 4th edition of Learning Perl now rather than waiting for Perl 6 to arrive. For my money, this is the best title that you’ll find to become acquainted with Perl, bar none. I think it’s also a bit improved in terms of organization and content since earlier versions of Learning Perl. If you’ve already learned Perl, of course, there’s no need to buy a new copy of the book — but it’s well worth the cover price for anyone who is new to the language.

Learning Perl 4th Ed.
by Randal L. Schwartz, Tom Phoenix & brian d foy
Published by O’Reilly
ISBN: 0-596-10105-8
283 pages

Comments are closed.