in reply to difference between OOPs in Perl and java

I'd say, Perl's defining OO treat is that it's very not-Perl. Perl gives you the very bare minimum to do OO: it has a way to associate references with package names, it has run-time method lookup, it'll stuff the invocant into @_, and a couple of bandaids that are more a PITA than anything else: AUTOLOAD and DESTROY.

And for the rest of it, Perl's approach to objects is like C's approach to regular expressions: C gives you pointers to lists of numbers, and that's enough to build your own regexp engine. Similar, Perl gives you the bare minimum to build an object system but leaves all the heavy lifting of building a useful system to the programmer. So we get to make the same mistakes again, and again, and again. So we have had hashref based objects, arrayref based objects, pseudo-hashes, base, fields, locked hashes, fly-weight objects, inside out objects, spiffy, fieldhashes, moose, mouse, and other things I cannot remember. And the next couple of years, people will find other implementations because all the previous ones suck.

  • Comment on Re: difference between OOPs in Perl and java