Your question could fill an entire book, in fact, it has filled many books! While i consider TheDamian's OO Perl the BEST book out there on the subject for OO Perl, i don't think i could honestly recommend it to you right now, simply because if you didn't get perlboot or perltoot - TheDamian's book might send you screaming.

First, i don't recommend learning OOP for the first time with Perl (and don't get me wrong - i love OO Perl). The reason is because Perl was not designed as an OO language in the first place. Java has a good model that is very easy to comprehend - Perl is flexible and as such, easier to get wrong.

Second, i don't feel that OO is the right solution for every problem out there. There is a good reason that Perl was not designed as an OO language in the first place - you have to design a framework first. Personally, i don't like having to do this for every single little utility script that i write, especially the ones that are used once and 'thrown away'.

So what is OOP all about? According to TheDamian (from the afore mentioned book), benefits might be:

  1. simpler analysis methods
  2. domain-oriented approach to design
  3. cleaner and more compact code
  4. more robust implementations
  5. greater code modularity
  6. easier debugging
  7. more comprehensible interfaces
  8. better abstraction of software components
  9. less namespace pollution
  10. greater code reusability
  11. scalability of software
If you get the idea that OO is for LARGE projects that involve TEAMS of programmers, then you are right. But you as a single programmer on a small app can still benefit, mainly with items 3,5,6, and 10 (just my opinions of course).

I started learning OO back in 1996 and i consider myself a little bit above an OO novice, just to give you perspective. It takes a bit of time before you get that 'OO click'. Go back and re-read perltoot and perlboot, work through the examples, eventually you will get it. If you have some code that you wrote that you feel might benefit from being 'ported' to OO, post it and one of us will gladly show you how to do so. Examples are the best learning tool, especially since there are so many buzz words that float around the OO domain.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

In reply to (jeffa) Re: OOP by jeffa
in thread OOP by Parham

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.