tombmbdil has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, The small set of scripts that began my initiatiation into to the world of perl have grown up. They now encompass a couple thousand lines of code covering many, many files.

There have been several stages throughout this creeping development where I've had the urge to go back and redo everything from the ground up... implementing all the new skills I've accumulated throughout the experience and rebuilding the project in an object oriented manner... but under the pressure of that unavoidable villain, the clock, I haven't had time to spare.

In it's current form I find myself spending enough time tracking bugs related to the complexity of the code that I think an object-oriented rebuild is a necessity, and luckily I've been granted a bit of reprieve from deadlines.

Anyway, irrelevant back-story aside, I'm about to delve into OO Perl research. I have a copy of the Panther (Advanced Perl Programming) handed down to me by a friend along with a recently purchased copy of the Camel (Programming Perl). From other nodes I have read, I gather that the Panther is more tutorial based, while the Camel is more of a reference. From the brief bit of reading I've done in both books, I do find the Panther much easier to follow. So, I was planning on familiarizing myself with OO Perl using the Panther, and then work with those skills to rebuild my scripts. After this I would probably be familiar enough with the concepts to tackle the more in-depth material of the Camel.

The only concern I have is with the age of the Advanced Perl Programming book. OO Perl seems like a topic that could have evolved quite a bit over the last few years. Are there any caveats I should look out for? Or can I rely on the Panther for sound, up-to-date working knowledge of OO Perl?

Replies are listed 'Best First'.
Re: The Camel and the Panther
by thraxil (Prior) on Jan 28, 2003 at 20:40 UTC

    the panther has a good, if somewhat shallow introduction to OO perl. it certainly isn't obsolete yet.

    of course, if you really want to learn about OO perl, sooner or later, you're going to have to pick up a copy of Damian's Object Oriented Perl.

    anders pearson

      Be sure to check out the errata for Damian's most excellent book. After I spent the time marking up my copy, the book made much more sense! There are at least 39 code improvements, many other corrections, and a few additions. Some of the fixes are quite clever! I recommend this book for learning OO.

      For me the hardest part of learning OO Perl is the lack of a definitive, paradigmatic way to implement inheritance. Instead it is TIMTOWDI, so an apodeictic book is problematic. Even now that I understand inheritance, recent nodes show that I am not alone in finding it knotty.

      It should work perfectly the first time! - toma

Re: The Camel and the Panther
by Sifmole (Chaplain) on Jan 28, 2003 at 20:42 UTC
    The Panther is decent, but I would pick up Damian Conway's book on Object Oriented Perl published by Manning -- much more complete and detailed.

    Also, along the lines of "complete rewrite" you might want to check out a book by Martin Fowler titled "Refactoring"; it might give you an insight into a different way to approach retrofiting existing code.

      Thanks, to both the above posters. Eventually I will have to check out the Damian Conway book. But, I can only devote so much time to research before I have to start 'doing' :)

      I think you're right, I should probably also do a bit of research into refactoring techniques before attempting the rewrite.

        If you can only read one, read Conway's -- better written and more complete.
Re: The Camel and the Panther
by dragonchild (Archbishop) on Jan 28, 2003 at 20:51 UTC
    Warning - Panther has buggy code in it. Some of the OO solutions do not actually work.

    Personally, I didn't like Conway's book or the Panther book. I do like the Camel book, a lot. Get the 3ed. book, not the 2nd. There's about another 200+ pages in it of good stuff.

    As for OO - LEARN REFERENCES. If you do not completely grok references, you will have serious issues with OO. Once you grok references, it's just a matter of understanding ISA and you're good.

    Now, that's for understanding Perl's implementation of OO. For actual OO design and coding practices, get a good generic OO book. I'm sure Martin Fowler or O'Reilley has one somewhere.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

      From skimming around I inferred that references would probably be pretty important, so I've spent the last couple of days reading up on them in both books. They complement eachother nicely to reinforce those concepts.

      I have university experience with OO from C++ and Java classes and some individual study of Objective-C, but no real-world experience.

•Re: The Camel and the Panther
by merlyn (Sage) on Jan 28, 2003 at 21:25 UTC
    If you like the way Learning Perl introduces you to the language, and you wish you had a book that was written in that style (by perhaps the same authors) that covered packages, references, objects, modules, testing, and distributions, perhaps your wishes will be fulfilled in a few months.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      *grin* That would be really awesome.
      I grew up (as a perl disciple) under the wings of Learning Perl.
      Is it going to be the platypus book?!? I like platypi ...

      ------
      We are the carpenters and bricklayers of the Information Age.

      Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

        They're platy-bloody-puses, mate !

        "Pus" as in octopuses is from the Greek, not Latin. And anyway this is English...AND

        It's also what they're called in the native habitat, when you +can+ call them.

        Meanwhile, peek a bit at the perlboot pod ... even if you have a basis in O-O concepts. Having heard Randal's presentation based on it, I recommend it as a good way in from the outside.
        I have this theory that I learn better if I actually find two or more ways "in" from the outside of an area I'm trying to understand... you may find the same thing. I certainly picked up a few Perlish nuances about objects that I hadn't otherwise grocked.

        Hm.... wonder if perlboot was the start of the new book ?
      What's the name of the book?

      URL?


      /J