tags:

views:

1413

answers:

12

I am moving into a project which has lots of Perl coding in it. Can somebody suggest me a good book which I can use to learn Perl? Online tutorials would also be helpful.

+10  A: 

I'd say that my first choice, if you've never touched Perl before, will be O'Reilly's Learning Perl by Randal Schwartz, Tom Phoenix, and brian d foy. My second one, which is a bit higher, would be Programming Perl by Larry Wall himself. One more, that is not, a book you'll really read like a novel, will be the Perl Cookbook which will give you a ton of little ways to do things. That's for the basics, you'll find a lot of other topics on the Perl's section of O'Reilly's collection.

Now, it's not a list of books you should buy, everyone has different needs and learn differently, but if you have a book shop nearby and they have those books, you should definitively have a look at them and see if they fit your needs. (Which I'm certain they will.)

mat
The Perl Cookbook is somewhat misnamed. Yes, it's a good how-to reference, but there's a lot more to it. It could be called "Hundreds of examples of problem solving in Perl with insightful commentary."
John D. Cook
That is what a cookbook is, no ? hundreds of recipes with comments, no ? At least, the cooking books with recipes I have are like that.
mat
+22  A: 

EDIT: And don't forget to read the FAQ!

dsm
Just reading your list brings back memories :)
Hates_
+7  A: 

Maybe http://books.perl.org/ would be the best answer. I heard specially good reviews for:

Learning Perl (5th edition); Randal Schwartz, Tom Phoenix, and brian d foy; O'Reilly Media

Janko Mivšek
Don't forget our fellow stacker brian d foy in that list of authors ;-)
Leon Timmermans
Ops, sorry Brian, but why the name with lowercase?
Janko Mivšek
+2  A: 

I found "Programming Perl" very helpful. "Learning Perl" is more directed to people who are new to programming.

Reading code examples is an additional way to gain some insides into the language. The "Perl Cookbook" has commented examples.

stesch
Actually, Learning Perl is aimed at programmers who don't know Perl, not people who don't know programming.
brian d foy
+8  A: 

If you're doing any OO Perl, another one to read is Damien Conway's Object Oriented Perl.

Once you've read that and understood it, go look at the Moose documentation, because that's what you should be using for OO Perl these days. (There are cookbook examples in the Moose documentation.)

genehack
Not only a great Perl book, but one of the best programming books period
George Jempty
+6  A: 

I learned Perl exclusively through reading the documentation (yes, man perl, although it is available online too) which is very well written in my opinion and contains several tutorials for different aspects. Then, getting familiar with CPAN was another important step.

Svante
+9  A: 

I would suggest adding this one to your Perl library, it is the one that has been most valuable to me, and I own a handful:

Marcus
Should save this one until you have the basics down, of course. As has been mentioned before, even if you don't adopt a single practice from the book, it will definitely make you think, and probably teach you a great deal about different approaches for writing maintainable Perl.
Adam Bellaire
+1  A: 

And don't forget Higher-Order Perl by Mark Jason Dominus.... a classic

/I3az/

draegtun
Very interesting, but not really applicable if you're just learning Perl.
Leon Timmermans
@leon - Yes but when I gave the answer the question was "Good books for Perl" ;-)
draegtun
+1  A: 

While there are a plethora of books dedicated to the topic of Perl and I could even name my own favorites (Learning Perl, the Camel book, etc), there is no replacement for experience. There is no better way to learn than to write code. You will learn the syntax and its ins an outs a lot better if you actually do it.

Also, keep a tab in your browser open to perldoc as it is an invaluable resource.

Regards,

Jeff

numberwhun
A: 

Another vote for the camel. I have it right beside me and it's very well detailed. The newest version is almost completely rewritten and covers the language pretty thoroughly.

John T
If you mean Programming Perl, it was rewritten a very long time ago and doesn't cover most of the recent stuff. It's still a fine book, but no longer a complete language reference.
brian d foy
+1  A: 

If you run the command perldoc perl you will get a list of Perl documentation pages and a suggested order for reading them. I recommend reading through as much of this documentation as possible over any book. In my early days as a Perl programmer I made myself read through one of these documents every work day after lunch. That's what truly transformed me into a Perl programmer.

I'd say get yourself a jumpstart from a book or tutorial (if you're not already familiar with basic Perl syntax), and then get into that documentation. Afterward you'll be better able to evaluate books yourself if you want to go more advanced.

As far as books go I have a special fondness for the out of print "Pink Camel," the first edition of Programming Perl. It teaches Perl in a way that would work wonderfully for people who don't even understand programming. It's also hysterical. However, a lot of what it says is relevant to old, old Perl; best practices today have moved far beyond what is in that book, and it would actually teach a lot of bad habits. The 2nd edition of Programming Perl was quite different from the first, and I think the void was filled by the Learning Perl book.

skiphoppy
+1  A: 

I think it's time chromatic's Modern Perl was mentioned. It's not in print as of writing, but you can download the content from his github. From a brief read, it's a Perl-from-scratch book, but it teaches best practices from the start, rather than teaching you the whole syntax and leaving you to learn which bits are not worth using later as the Camel does. It also covers modern innovations such as Moose in some detail.

Philip Potter