We write a lot of Perl code where I work, and we write a lot of OO Perl in the sense that we use bless and call methods on objects and classes a lot. But I'm starting to realize that we are Perl developers writing OO Perl in much the same way as a C programmer writes Perl, if that makes sense.
<rant>

Unfortunately, this makes all too much sense. Perl's OO system is really just a thin veneer over the module system and reference types, which really are just the primative building blocks for a real object system. This is not really all that uncommon though, many languages made the move from structured programming (modules, abstract data types, etc) to OO by similarly enhancing existing features. But as the 90s moved into the 00s and Java became every managers dream come true (and many a developers nightmare) the idea of "True" and "Pure" OO became more important than an OO tacked-on to an existing feature set. To be honest, Perl 5 is behind the times on this, Languages like Python and Ruby, which have much more complete OO systems are really making Perl 5 look bad (at least IMHO). Sure, we have TIMTWODI so we can do our OO any way we want, but in practice this has lead to lots of incompatible approachs and extreme work arounds like Inside-Out classes. If you dont believe me you need only see all the crap people are talking about Perl on the Bugzilla wiki. So much of the "Cons" being brought up are not really cons, but bad usage patterns and misunderstandings of features. And while I really hate to say it, it is my opinion that this is really a case of "TIMTWODI gone bad". A lack of any kind of OO "Best Practices" (and no I do not mean TheDamian's book) is hurting Perl. But anyway enough ranting ...

</rant>
I'd love to hear recommendations on what other resources people have found useful for learning how to better apply OO techniques in Perl.

Practice, practice, practice. There are many good OO books out there which teach OO technique (many already mentioned by other posters), but they are no substitute for actually writing real-world code, and even more importantly, maintaining and extending that same code. The cycle of writing and refactoring of an OO codebase over several years has taught me more than any book ever could.

-stvn

In reply to Re: Really Writing Object Oriented Perl by stvn
in thread Really Writing Object Oriented Perl by agianni

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.