tags:

views:

294

answers:

8

Hey guys.

The book in question is called 'Learning Perl, Third Edition', by Schwartz and Phoenix - printed by O'Reilly in 2001. Is this book too old? Have there been significant improvements to the language over the last 7/8 years that warrant a newer book on the subject?

Thank you.

+3  A: 

Learning Perl's 5th edition came out in 2008. There must be reasonably important changes to justify two new editions.

In general, computer lanaguages and software change so rapidly that it's best to learn from recent editions. Perl may not have evolved at the same fast pace as Ruby, Python, or Groovy during the last decade, but even if the language hadn't changed dramatically there still would be developments in Perl packages and tools that you'd want to learn about.

Be sure to look for highly rated books (eg, read reviews on Amazon). Book quality varies a lot, and if you're going to study a language you want the very best information presented in a clear, understandable way.

Jim Ferrans
however, the scene has changed so much in the last 6 months that no printed media are relevant to the new stuff.
Kent Fredric
True, many important modules have been added and others have changed dramatically in the last few months, but the basics of the language were relatively unaffected.Learning Perl 5th edition does cover Perl 5.10, so it should not be too out of date.
fB
@Kent: Learning Perl is about learning the basics. Not much has changed with that. If you teach how to use modules in general, as Learning Perl does, you don't have to teach people how to use any particular module.
brian d foy
+14  A: 

That's a fine book to learn the basics from, especially if you're not already a programmer. They're on the fifth edition, but the basics remain the same. Compare the fifth edition's table of contents with your own to see. books.perl.org provides some further recommendations.

Learning Perl doesn't go too far into the language. In particular it doesn't cover OO, module development or complex data structures. For that the next book is Intermediate Perl.

The changes to Perl in the last eight years are far more about programming technique and CPAN (3rd party) libraries than language differences. Development of the core Perl language moves slowly but development of the community and techniques moves quickly. In particular Perl OO programming has changed rapidly in the last few years with the development of Moose and surrounding technologies. Also since that edition of Learning Perl there has been a big focus on testing. As Modern Perl says "Modern Perl programming, circa 2009, relies on the collected wisdom of the entire Perl ecosystem. It's time to write elegant, reliable, maintainable, well-tested, and predictable code."

Schwern
+2  A: 

There have been incremental improvements, but as long as your book covers, say, version 5.6 and higher, you'll be fine. The basics are still the same.

Barry Brown
+1  A: 

Perl, Like C, has a few books which remain bibles to the language regardless of age. When Perl 6 comes out, Perl 5.x will still be widely used due to mounds and mounds of legacy code in use, and much of the information will still be relevant to Perl 6.

The two main books that come to mind include "Learning Perl" (the only you currently have), and the book commonly touted as "The Camel", which is actually titled "Programming Perl" and written by Larry Wall himself. These books are to Perl what K&R is to C, Bibles.

John T
+7  A: 

Older Perl books are both good and bad. For issues involving the core languages, like references, regular expressions, variable scoping, and so on, not much has changed. For actual programming tasks, like communicating with a subprocess or creating a web page, most of the printed material is highly outdated. (Even though Catalyst is still the web framework of choice, my Catalyst book is now horribly outdated. And it's only a year and a half old!)

Basically, you will learn good things from Programming Perl and the Learning/Intermediate/Mastering Perl series. You should read them. Just realize that although those books are good, there are even better ways to do things now. (Reading blogs like http://planet.perl.org/ should help you get a feel for what the community considers good these days.)

Here is my current list of must-know modules for practicing Perl programmers:

  • Moose: for OO
  • Catalyst: for web stuff
  • DBIx::Class: for communicating with your database
  • POE or AnyEvent: for anything that needs an eventloop -- running external programs, or writing a network service

There are probably lots of things I am missing, but if you know the Perl basics, and you know how to use these libraries, you will do well in the Perl world.

jrockway
Catalyst is now written using Moose.
Brad Gilbert
And Perl is written in C. Your point?
jrockway
I wouldn't say that there are better ways to do things than what I present in Learning Perl, Intermediate Perl, or Mastering Perl. Those books focus on teaching the Perl language basics. They specifically don't teach things built on top of the Perl language, like Moose or Catalyst. As you say, if you learn the basics of using modules, however, you should have an easy time picking up these other topics.
brian d foy
+1  A: 

There have been significant changes to Perl since 2001 but not very much to the fundamentals. You can look on http://perldoc.perl.org/ on the History/Changes page http://perldoc.perl.org/index-history.html to see the major changes back to perl 5.004 which is more than 10 years ago.

You can read the book you have but it will be behind-the-times in some areas.

+5  A: 

3rd edition, AFAIR, describes Perl 5.005. It is very old.
Some of important simple changes:

  • our instead of "use vars"
  • qr// instead of //o
  • "use warnings" instead of "perl -w"
  • "open my $fh,'<',$filename" instead of "open FH,"<$filename""
  • given/when instead of Switch.pm
  • signatures.pm (requires installation from CPAN) for sub signatures

There were many other important changes, but this list is enough for start.

Perl::Critic will advice on using some of modern constructs.

Also you can try reading "Beginning Perl". It describes Perl 5.6 and also has exercises.

Alexandr Ciornii
Most of that is covered in the Fifth Edition of Learning Perl, which is up-to-date for Perl 5.10.
brian d foy
A: 

There are also plenty of tutorials and blogs on the web, to supplement your learning (along with the standard sites like PerlMonks, this site etc). Try this one:

Perl Tutorial

DBMarcos99