The author has a very methodical way of introducing concepts and overall has done a very good job. What seems like easy flow as far as the reader is concerned was probably a lot of hard work on his part.
The wry humor in the book alone is worth the money.
I am still unable to take the plethora of my perl scripts and modularize them but that is not the author's fault.
Compare this book with " Learning Perl Objects, References & Modules By Randal L. Schwartz". This does a much better exposition.
thanks
Sidhaartha
For those like me who are forced to write Perl against their will, this book is a must-have. In contrast to some other Perl books out there, this one doesn't get into cutesy terminology like calling things 'spaceship operator' or similar uses of sloppy informal language.
I don't recall what caused me to buy this book; perhaps it was the only Perl OO book. I am so glad I did, because the amount of info that the author has put into this book is amazing. Not just that, it's the *choices* he made, of what to explain. He's picked all the pieces that the other books glossed over, and examined the missing pieces, so that I now understand the"why" behind many oddities, and I now can push myself much farther forward.
Sort of like, the other books pose the questions, this book answers them.
If you only buy 2 Perl books, make this one of them. Ignore the fact that the title says OO. Yes, it does a great job of explaining how the OO features mechanically work, but the reason to buy this book is all the extra backgrounder info that's in this, it's worth twice what they're asking for. The data often has nothing to do with the OO features, he's probably remembering all the details that HE had to go run down, and he's giving us all these data pearls (pun intended) for free, along with the payment for the OO data.
Don't buy this book to learn object-oriented programming, but if you want to learn how Perl manages to add OO features, and accidentally learn how Perl adds in a great many other features, then you're in the right place.
I consider the first two chapters ("What you need to know first" and "What you need to know second") to be well written and quite useful. These chapters effectively and succinctly expressed the non-OO aspect of Perl programming. When I delved excitedly into chapter three, however, it seemed to me that Damian Conway lost his interest in teaching Perl, in lieu of underlining his own mastery of the language. Too many times I recall his overly complicated one-liners getting in the way of a clear explanation of the point he was trying to convey. I bought Damian Conway's OO Perl because I wanted to learn more about object orientation in Perl-not to view obfuscated code. A *lot* more clarity would have the made the book much more useful.
A second frustrating point about the book is how Damian writes a given class, and then fails to provide even a simple example of how to use said class. As a programmer reading the book, I found it quite annoying that I had to so often write my own "class calling" scripts. Of the many classes contained in the contents of the book, I recall only one or two working examples of how to use said classes! This baffled me throughout the book. I kept wondering, "Are examples of how to use these classes available on a website or something?" Even as I write this review now, I'm shaking my head at the lack of examples provided in the book.
In my opinion, the most appropriate title for Damian Conway's book is "Obfuscated Object Oriented Perl." The solid first two chapters aren't worth the ...cost of the book, and the OO chapters (3-14) are practically worthless-both as a reference, and as a means of instruction. The freely available OO Perl tutorials are of much more value than Damian's book. Said tutorials will not only save you money, but they will also bolster your understanding of OO Perl, which is something I so greatly wanted, but so widely failed to receive, from Damian Conway's OO Perl.
But you can't figure out the point of some of those perl features. Blind hashes? What are they for? And that 'bless' instruction? And typeglobs- huh? Maybe you're puzzled by that odd syntax some of the CPAN modules use- $class->export($var)? What's that all about?
Relax. You've just stumbled into the world of object-oriented perl programming. And it's not as hard as you may think. Conway does a wonderful job of explaining how OOP works. His examples are perfectly transparant, and perfectly obvious. And he shows how OOP construction can be summed up neatly in three simple rules.
There aren't a lot of prerequisites needed to make good use of this book. If you've got a basic familiarity with perl, and some basic experiece with programming, you're ready to dive in. Conway even gives you a review of the necessary perl essentials you'll need in chapters 2 and 3.
A first-rate book, and one destined to be a perl classic.
The book is a well paced introduction to OO, illustrating and implementing the core concepts of OO in the context of Perl. While the earliest chapters serve as building blocks to those that follow, the later chapters need not be read front to back, but rather as the topic appeals to the reader.
Topics covered include: inheritance, polymorphism, ties, operator overloading, encapsulation, genericity, multiple dispatch, and persistent objects. Each topic is introduced along with code which highlights how each technique helps to solve common real world problems. As various tips, tricks, and pitfalls are covered, the reader will often find themselves revisiting and evolving improved solutions to familiar problems.
A lot of languages implement a particular flavor of OO. And indeed, OOP shows a variety of the techniques and flavors of OO and how they may be implemented in Perl. -Explaining when and where each may best be used, and trade-offs involved. As a result, the reader comes away from the book with a greater understanding of OO, and not just a single style embraced by a particular language.
Conway and Schwartz are well-known and respected throughout the Perl community. Their writing is clever, humorous, and while information dense... surprisingly easy to follow. There is a sense of grace and continuity to their writing which made this book a real pleasure to read.
Perl is not C++, it's not Java, and it's not Smalltalk or Eiffel. But Conway gives a wonderful perspective about the differences (and similarities) between all of these languages, and even a straightforward glossary to help you "translate" from one to another where appropriate.
The best thing I can say about this book is that it's actually useful. In a sea of unnecessary Perl books (Programming the Perl DBI comes to mind), this book stands out as an immediately valuable tool that you will continue to use over and over again. It has a great rudamentary Perl primer section, object oriented programming primer and, of course, Perl's application of these ideas.
This book has definitely helped me to write better code, period. Buy it.
If you like clean OOP language, skip Perl and use Java/C# instead. But if you still want a scripting language like Perl, try Python or Ruby instead.
The writing style of Mr.Conway (I mean English in the first place here) is worth to be mentioned explicitly. Well... you can read this book just to entertain yourself. If it won't make you laugh by the time you are done with the first chapter,there is something seriously wrong with you.
Right now I am a half-way through this book, most probably having a lot of interesting things yet to discover. Now I am writing most of my Perl code once. If I have to write it twice, I am considering writing a module :).
Just one wish (probably for the next edition): I think the book will be even more entertaining if you'd add exercises and answers to them (as in "Learning Perl"). For me, the problem was where and how to implement all that what I've learned from this book. Well, that was just in the beginning :).
A rare book is as good investment as this one. Thank you, Mr. Conway!
One 'but': the code examples, is really anyone going to use this or to inspirate with the showed code? maybe better ideas for this(maybe a game and not a CD collection) would be better, but i would buy this book even without any code and even with price doubled.
In the other hand, if you know very well the object concept (very well), maybe the book isn't for you cause one of the proposal of the book (i think) is (paralel to show the perl aproach to objects) to teach the theory.
But probably your object-oriented concept is poor compared with your future idea of this if you finally read this book.
Having "Learning Perl" would help but not necessary because the author covers the perl intro in the first chapter. But that is all you need!. Brilliant writing. Each and every page carries so much information!..not a single page has been wasted.
There is comparison of other OO languages with Perl at the end and i found that very very helpful (coming from a java background)
I have bought 3 manning books so far..
Server based java programming, web development with jsp and now OO Perl. and am convinced that Manning publishes some of the best books around. If someone from their side is reading this...
PLEASE...PLEASE release all your books in India....don't be selective... we've been waiting for some of your titles for long and none have come through as yet!.
and..
even if you are a perl newbie with an exposure to programming(
as i am) , this will teach you all the perl OO tricks.
So BUY this if you want to do OO using Perl.
So I was a true OO Perl programmer(well, that's who I thougt I was then). Still I wanted to give a try to Damian's "Object Oriented Perl" due to lots of positive reviews the book earned.
Upon buying this book I discovered so many features of OO Perl that I had been missing. I never thougt of using aythings except reference to a hash variable as data structure for my objects (have you?). When Damian started talking about objectifying arrays, subs, typeglobs and even *RegExp* in addition to annonymous hashes, I felt like tearing off all the pages from my previous OO Perl tutorials and eat it.
I was pleased.
The organization of the book is quite logical as well. I found it even better than some O'reilly's Perl books (I love O'reilly), and this was my first book from Manning.
The author builds the base for you to get started with through the first two chapters ("What you need to know first" and "What you need to know second").
The third chapter introduces you to all the basics of Object Oriented Programming in Perl, which all other tutorials out there mostly deal with. In this chapter, you build CD::Music class for managing your CDs.
The fourth chapter, "Blessing Arrays and Scalars" starts off with the section "What's wrong with a hash?" Only then I discovered that hash was not the only data structure I could use for my objects (well, not that I didn't know, but never thought of). In this chapter he also introduces to the pros and cons of blessing arrays, pseudo-hashes, scalars and supports each with an example
Chapter five is even more teasing, which talks about "bless"ing regexps, subroutines and typeglobs.
The rest of the book (starting on page 168) is dedicated to standard OOP lingo, techiques and their implementation in Perl
Language of the book is plain english. I found some of the wordings a little different than I am used to (en-us), but doesn't effect the comprehensibility (is there such word?) of the book at all. It was like taking couple of days off from my O'reilly books.
To illustrate some of the complicated structures (such as inheritance tree) the author uses charts and diagrams. I found them really helpfull, easy to read and understand.
If you are into Perl, and want to get more advanced with Object Oriented features of the language buy this book.
The book definitely " bless $my_eyes => $OOP::Perl5; "
With regards to the book, the subject matter is clearly laid out with prodigous examples, and explanations of why things work.
He also gets into the nitty-gritty details of _how_ things work, which is essential for "deep" programming.
There is no reason on earth any perl programmer should find themself without this book.
Even if you don't write objects in Perl, this book is sure to teach you some new Perl tricks.
little gems in the code examples like "..etc.." make it worthless as reference.
If you don't understand oop abstraction from a C++ university world, your lost. There is no what-is-actually-going-on explinations of the perl code in regards to replication of data structures in memory, or reference munging in the symbol table.
There is little to no helpfull information assosciating code design to the management of files (otherwise known as packages) module heirarchies, or namespaces.
Every oop question I have had while working with perl that has been referred to this book has gone unanswered.
Basically, this book is only usefull if you have already been taught to think and design in an oop world, including a full understanding of all the idiotic jargon used to describe an action that is going on in the real world, in real memory, and with a real processor.
If you already have a good understanding of what an object (data structure replicated in memory), class (a bunch of em that conform to the same IO mechanism and behave the same), and method (code-routine that acts on that "object" data structure) then this book might be worth your while.
Except of course, that if you knew that, you could learn everything this book is going to tell you by simply looking at the syntactical structure and reading a few paragraphs in the camel book.
my $firewood = shelf->remove_book() ;
Reading this book brought me back to the days when I was learning perl for the first time. Every turn of the page will illustrate a new concept, and a new way of doing things.
There has never been a time when I was learning perl, that I learned more, faster, quicker, and easily than when I was reading this book.
Although the book is perfect, besides the typoos (, but there is an errata page on the www), one wonders, whether perl is the ideal language for object oriented programming. It becomes once more clear, that perl is the most powerful language, but also the most complicated one. If one would apply the "tie()" function regularely, then nobody could read the code any more. Despite that, the book is needed, because perl is now everywhere, and it can only be good to master it.
The chapters of the book are: 1.) What you need to know first (an object-orientation primer), 2.) What you need to know second (a Perl refresher), 3.) Getting started, 4.) Blessing arrays and scalars, 5.) Inheritance, 7.) Polymorphism, 8.) Automating class creation, 9.) Ties, 10.) Operator overloading, 11.) Encapsulation, 12.) Genericity, 13.) Multiple dispatch, 14.) Persistent objects, A.) Quick reference guide, B.) What you might know instead [about other OO languages].
Congratulations Damian, and Thank You (:
Conway also gives a very thorough coverage of implementating true data encapsulation in Perl and presents several methods for doing so.
Another thing that struck me about this book is Conway's attention to detail. In his code samples, he carefully explains why each line was written a certain way. He even notes which version of Perl a certain feature or module first appeared in.
All in all, a wonderful book. Even if you have been developing in Perl for a while this book has something to offer.
I do wish this had been released a few years ago as it has pointed out a few errors in the way that I have been doing things. My ways work, but Damian shows techniques for improving the efficiency of object that I hadn't thought of before.
If you are at the point in learning perl that you are starting to cut and paste code from your other scripts to do the same thing in a new script - it is time to buy this book. Cut and paste that code into an new module and you will never need to copy it again, this book will show you how.
Even if you are just 'making a module' and aren't really thinking of making classes and objects, read this text - or at least use it as a reference. By doing a small amount of extra work beyond making a module you will be doing OO programming. This book shows you how easy it is to do.
My only complaint about this work, which is more of an opinion that isn't relative to its rating, is that I think Perl programs are more beautiful and elegant when they don't embody complex scaffolding of the type that this book so ably describes. I see this book as a Perl counterpart to Coplien's Advanced C++, but in the case of C++, it's possible to bury scaffolding in a library out of sight in a way that isn't quite possible in Perl. I'm not sure how many Perl programmers actually know C++ (my experience is that it's a surprisingly small number) but I think that C++ is a language that tolerates and even demands such complexity in a way that Perl doesn't.
One thing for sure--the coverage of objects here is vastly superior to that in the turquoise Camel book (Programming Perl). I'm sorry, but I think the topic deserves more descriptive terminology than "thingy." Conway knows his concepts, knows how to execute them in Perl, and sets them down lucidly and, yes, exhaustively.
I'm not sure it's worth it in the long run, but that's just me, and obviously others see architectural tradeoffs differently. Meanwhile, this is an excellent, literate work that enhances both the capabilities of programmers and the stature of Perl. If nothing else, studying it will definitely improve your understanding of the language and idioms of Perl. But I would expect it to be more rewarding than that.
One of the difficult things about writing a technical book is maintaining high content quality without putting the reader to sleep. Damian manages to keep the content quality VERY high, and at the same time write a thoroughly entertaining book.
And speaking of content -- everything you ever wanted to know about objects in Perl is in this book, complete with working examples. In addition to the standard objects-implemented-as-hashes technique, you'll learn how to implement an object as an array, a scalar, or something more esoteric, such as a regular expression, a subroutine, or a type glob. Other topics include operator overloading, tied variables, and persistent objects.
And, if what's in the book isn't enough, each chapter has a section titled, "Where to find out more," -- a sort of mini-bibliography for the chapter.
A must-read for all Perl hackers. Buy it now.
To my ever-growing stack of O'Reilly Perl books, I've just added this gem, which fits nicely alongside Effective Perl Programming (ISBN 0201419750 for the uninformed) as a non-O'Reilly Perl book that every Perl programmer should have at their disposal.
Not content with writing just a Perl book, Damian Conway spends the first chapter explaining normally confusing object-orientation concepts in a very clear manner. This tutorial alone is worth a good chunk of the purchase price, especially if you tend to find typical articles on object-oriented programming overwhelming. To fill the rest of your order, the next 400+ pages are pure Perl, as Conway takes every concept introduced in the first chapter and spends a chapter on each one, showing you how Perl accomplishes them. The examples and code samples are very clear, very real-world, and (thusly) very easy to understand. A good deal of time is also spent on tricks and optimizations to help reduce the much-touted performance hit from OO Perl. The later chapters dive into more advanced topics and start combining all the core concepts together.
Besides teaching all the ins and outs of OOP, a good number of paragraphs are also devoted to non-OOP advanced Perl techniques. This book transcends its title; it's a book for anyone looking to move into the advanced Perl realm, OOP or not.
This book has definitely helped me increase my level of Perl competence and the knowledge gained is presently working to streamline a number of projects I'm on. I'm elated. I think I'll play my air guitar in celebration.
Since this book was written years after the original OO perl tutorials, Damian has had the advantage that time allows. He reports, in a clear style, how programmers *really* use the OO aspects of Perl. He reports what practically works, rather than what could theoretically work. He *builds* on the first generation of tutorials that, since they were written so early, did not have practical field experience.
Clearly written. Practical. Well organized. Thorough. Useful. Substantial examples.
Damian clamins to enjoy writing Perl over C++ because he'd rather write Haiku than legal documents. His clarity and playfulness shows.
The book itself is useful in parts, although overly long for its subject matter, and often confusing. Explanations are often made harder to understand by the examples, not easier. The author spends too much time discussing BAD approaches to a particular problem before showing us the "right" way.
Overall, inferior to "Advanced Perl Programming" in its approach to teaching OO-Perl.
And the best thing about this book is that, on the way to explaining various OOP concepts, it manages to elucidate all sorts of non-OOP advanced programming techniques in Perl. So I recommend this book to anyone who's finished /Learning Perl/ and is looking for what to learn next.
It's a surprising achievement, and one that makes this book very worthwhile reading for people who don't even particularly care about OOP!
And, conversely, because /Object-Oriented Perl/ touches on so many of the possible approaches to OOP, I think that this book would be interesting to people who are interested in OOP, but not terribly interested in Perl per se.
It is, in short, a book of immediate as well as lasting value.