Tutorial :Where can I find object-oriented Perl tutorials?



Question:

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.


Solution:1

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


Solution:2

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

perlboot is now deprecated, and re-directs to:

perlootut - Object-Oriented Programming in Perl Tutorial

perlobj - Perl object reference

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


Solution:3

The Conway book is a classic.


Solution:4

Moose::Manual


Solution:5

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.


Solution:6

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.


Solution:7

Inside-out Objects by Randal Schwartz.


Solution:8

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


Solution:9

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.


Solution:10

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.


Solution:11

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).

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »