tags:

views:

630

answers:

11

A Google search yields a number of results - but which ones are the best?

The Perl site appears to contain two - perlboot and perltoot. I'm reading these now, but what else is out there?

Note: I've made this community wiki to attempt to produce something better than Google, which appears to have mediocre tutorials that are more about object-oriented programming than object-oriented Perl style and techniques and the two on the Perl site. One tutorial per post + a summary of the good/bad things about the tutorial would be best so we can let the best tutorials float to the top.

+8  A: 

Since this is community wiki and in the spirit of your note:

perlboot - Beginner's Object-Oriented Tutorial

If you are new to Perl, this tutorial also suggestions that you read about subroutines, references, and modules.

innaM
This is, by the way, the cut-down version of the same material in our book _Intermediate Perl_.
brian d foy
+5  A: 

Moose::Manual

zoul
Moose is great, but also new and quite chunky. It might not be suitable if you want to learn how to work with most existing OO-Perl code.
David Dorward
I would strongly recommend *not* reading the Moose tutorial right away, until one is familiar with how Perl natively does OO. Moose is confusing enough as it is without understanding how it's put together under the hood. See http://stackoverflow.com/questions/980751/should-i-learn-perl-5-oo-or-moose-first
Ether
@David: chunky? Do you have in mind the amount of code that Moose loads or its syntax or <insert other answer here>?
Telemachus
A: 

Moose::Manual::Unsweetened helped me a ton.

Oesor
Moose::Manual has already been posted. This is just a subsection of that tutorial.
Thomas Owens
+2  A: 

Inside-out Objects by Randal Schwartz.

Sinan Ünür
+5  A: 

The Conway book is a classic.

David Dorward
+8  A: 

Damian Conway's Object Oriented Perl has two essential chapters and all the source code online.

Sinan Ünür
Telemachus
@Telemachus: I am referring to the chapters posted on the page I linked to as *essential*. The state of the art in terms of encapsulation might have moved on, but I still think Conway's treatment is a good resource to understand whence the state of the art moved. See also my other link on inside-out objects. Studying both of these resources will, IMHO, help the reader understand why Moose exists ;-)
Sinan Ünür
+5  A: 

While not a tutorial, I'd suggest have a read and work through the examples of Learning Perl Objects, References & Modules which is the second book in the Randal Schwartz's "Learning Perl" series.

This book is an excellent intro to Perl objects.

BTW I prefer this version over the later edition which has also been given the more generic title of "Intermediate Perl". And, as an added bonus, a second-hand copy of the older version is much less than the new edition. (-:

Edit: I forgot to add a pointer to the excellent OOP meta-tutorial over at Perl Monks which gives you pointers to what you need to know to start OOP in Perl and then points you towards several other tutorials on OOP at several levels of difficulty.

Rob Wells
Learning Perl Objects, References, and Modules is old. We retitled the latest edition as "Intermediate Perl". It's updated and has more stuff.
brian d foy
Still prefer the older, not "written by a committee", versions. Don't know why. It's the same for Learning Perl after edition 3. The style of writing changes. Much better to forget that book and just dive into The Camel book instead IMHO.
Rob Wells
+1  A: 

There are a couple of object-oriented tutorials in the perl documentation. Check out the perltoc documentation. perldoc.perl.org has a page that list all of the Perl tutorials in the documentation.

brian d foy
+1  A: 

There's a pretty good prestentation at tobez.org. It doesn't cover Moose, but it has a good overview of "classical" methods, and also goes into CPAN modules and techniques like blessing unusual references and inside-out objects.

daotoad
+3  A: 

I'm a big fan of the materials available on the Perl Training Australia website.

They have an introductory tutorial available as well as a full-sized book-length treatment:

All their course materials and tips are well-worth looking at.

Telemachus
A: 

Starting Object Oriented Programming with Perl at Suite 101 is bad for a number of reasons and should be avoided.

Why the tutorial is bad:

  1. Shows non-inheritable constructors, but uses them in an example for inheritance
  2. Uses indirect method call syntax
  3. Does weird, buggy stuff to access arguments in code samples
  4. This is a minor niggle, but the author uses a big string of concatenation with a print where a list of arguments would work better (or better yet a join).
daotoad
I don't know if I should upvote this because it's a suggestion of one to avoid and provides good reasons why or downvote it because it's not supposed to bubble up to the top...
Thomas Owens