By bonlebon
via codeproject.com
Published: Apr 15 2007 / 10:56
Most people are not aware of the fact that Perl has support for object-oriented programming. If you've used another object-oriented programming language such as Java or C++ or been exposed to object-orientation, then object oriented programming in Perl is nothing like that. To do real useful object-oriented programming in Perl, you only need to use three simple rules as put forth by Larry Wall in Object Oriented Perl.



Comments
jmcantrell replied ago:
Man, POOP is right. I've written ton of perl scripts that make my life much easier, but the syntax makes me shudder. This article is a good example of this.
Hercynium replied ago:
I agree, though I just want to point out that while Perl doesn't support the concept of public/private/protected, and you'll often have to jump through syntactical hoops to do more advanced coding, it's about as feature-complete from an OO standpoint as one could want. (The functional-like stuff is nice as well)
Hercynium replied ago:
Oh, yeah, one other thing - once you really 'grok' the syntax, and understand what's going on under the hood, Perl has some really nifty ways to cut down on boiler-plate code and accessors and such, owing to some of the afore-said functional nature.
That being said, if you want pretty code, go with Ruby (I guess, since that's what I hear about R. However, I'm professionally neck-deep in POOP).
Voters For This Link (13)
Voters Against This Link (1)