Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

How to learn Object Oriented Perl

by ghenry (Vicar)
on Oct 04, 2005 at 09:23 UTC ( #497165=perlquestion: print w/ replies, xml ) Need Help??
ghenry has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

Have I missed any resources that could help me further?

I have read (just about):

I also have Learning Perl Objects, References, and Modules, but not Object Oriented Perl.
Have I missed anything?

Thanks.

Walking the road to enlightenment... I found a penguin and a camel on the way.....
Fancy a yourname@perl.me.uk? Just ask!!!

Comment on How to learn Object Oriented Perl
Re: How to learn Object Oriented Perl?
by Perl Mouse (Chaplain) on Oct 04, 2005 at 09:29 UTC
    Yes. You've only read. You learn Perl OO (and just about anything else in Perl) by just doing it. ;-)
    Perl --((8:>*
Re: How to learn Object Oriented Perl
by halley (Prior) on Oct 04, 2005 at 14:02 UTC
    Most of those materials just discuss Perl's syntactic sugar which allows OO-style development. They offer very little in the way of wisdom about OO design.

    The bit about "Perl Design Patterns" seems closer to that mark, but again it's just showing some implementation examples to people who are already mostly familiar with the concept of Design Patterns.

    Knowing how polymorphism can help you clarify your design is something that takes hands-on learning. Knowing the theories about messaging, and encapsulation, and accessors, and the difference between aggregation and inheritance, will only take you so far.

    I suggest you pick a problem which needs solving, and solving it yourself. Repeat this cycle a few times. You can read a cookbook all you want but you can't learn to knead bread until your hands are intimate with the eggs and flour. Your first loaf won't be a success, either.

    (Update: I wrote this assuming that you're not familiar with OO because you're asking about OO-perl. I based this on the assumption that those who know about OO are probably going to pick up the perl-specific basics of OO-perl in about a day, and won't really fret about it that much.)

    --
    [ e d @ h a l l e y . c c ]

      Most of those materials just discuss Perl's syntactic sugar which allows OO-style development. They offer very little in the way of wisdom about OO design.
      Which is exactly what you'd expect from those pieces of documentation. OO design is language independent, and hence, you should expect material discussing OO design among the documentation discussing the syntax and features of a particular language.

      If I buy a set of crayons, it might tell me how to open the package, and how to properly store them. It doesn't tell you how to produce art though.

      Perl --((8:>*
Re: How to learn Object Oriented Perl
by pajout (Curate) on Oct 04, 2005 at 16:37 UTC
    Imho, it depends on your requirement - somebody wants to use own simple objects and somebody wants to hack everything :) I read some 'man perl*' manuals and Advanced Perl Programing, by Sriram Srinivasan. Good luck!
      I second the suggestion regarding Advanced Perl Programing, by Sriram Srinivasan. It has some good stuff about OO and classes in Perl. Plus some useful examples.
Re: How to learn Object Oriented Perl
by signal9 (Pilgrim) on Oct 04, 2005 at 17:20 UTC
    Are you familiar with OO programming as a concept? When I first tried to tackle OO, I was not strong in OO concepts, and I found Perl to be a difficult place to start learning. I found working with other readily available OO languages like JavaScript made getting my head around object concepts a little easier. Then I was able to come back to OO Perl with a better idea how objects should behave.

      I think that's the problem and what I am working on at the moment, is the OO concept. Not with Perl, but just in general.

      I am going to try and find something on the web in or the library that is just generic.

      Walking the road to enlightenment... I found a penguin and a camel on the way.....
      Fancy a yourname@perl.me.uk? Just ask!!!

      Guess what I have been reading now:

      Lesson: Object-Oriented Programming Concepts - on the Sun website ;-)

      Walking the road to enlightenment... I found a penguin and a camel on the way.....
      Fancy a yourname@perl.me.uk? Just ask!!!
Re: How to learn Object Oriented Perl
by AllenR (Initiate) on Oct 04, 2005 at 19:41 UTC
    When I started my current job, I was hired to test/develop OO Perl. I knew OO, but not much Perl. Object-Oriented Perl by Damian Conway is a good book. It helped me refresh my OO knowledge, and should help if you have no OO background. Most OO books about design are rather bland reading, so with all of the other reading you've done, I'd shy away from suggesting too much more at this point. What helped me the most was taking others' objects and dissecting/testing them. If you have the ability to examine a complete Perl OO application, do so. That's the best way to learn, IMHO.
Re: How to learn Object Oriented Perl
by kirbyk (Friar) on Oct 04, 2005 at 21:58 UTC
    One great text not mentioned is Conway's Perl Best Practices. It just came out from O'Reilly, and has a nice chapter on Object Oriented best practices, including how to make your object encapsulation as secure in Perl as in traditional OO languages (and, in fact, more secure, because Perl is just that cool when you do it right.) Really, a great book for an intermediate programmer, even though nobody will agree with everything in it. You'll learn a few extremely useful things that you won't believe you lived without before reading it.

    -- Kirby, WhitePages.com

      I have that in front of me ;-)

      That's where I learned about protecting the implementation of your objects like you say.

      I really think this book is a *must* have for any Perl programmer/Company.

      Walking the road to enlightenment... I found a penguin and a camel on the way.....
      Fancy a yourname@perl.me.uk? Just ask!!!
Re: How to learn Object Oriented Perl
by Trix606 (Monk) on Oct 06, 2005 at 14:38 UTC
    The Object-Oriented Thought Process was one of the a-hah! books for me. At 240 pages (1st edition, link points to 2nd edition) it was a good introduction to the concepts. I would suggest reading this first and then Object-Oriented Perl.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://497165]
Approved by Corion
Front-paged by Tanktalus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2014-09-22 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (191 votes), past polls