English 中文(简体)
Where can I find object-oriented Perl tutorials? [closed]
原标题:
  • 时间:2009-11-09 14:39:59
  •  标签:
  • perl
  • oop

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 4 years ago.

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.

问题回答

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

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.

The Conway book is a classic.

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.

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.

Inside-out Objects by Randal Schwartz.

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

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.

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.

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




相关问题
Why does my chdir to a filehandle not work in Perl?

When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...

How do I use GetOptions to get the default argument?

I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...

Object-Oriented Perl constructor syntax and named parameters

I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...

Where can I find object-oriented Perl tutorials? [closed]

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

热门标签