http://www.perlmonks.org?node_id=339453


in reply to Re^7: It's a dog, but what kind? (polymorphism , in Perl OO) (alternative?)
in thread It's a dog, but what kind? (polymorphism , in Perl OO)

And tye, back at ya. Did you understand the responses you got to that posting, or the thread in this posting?

The "alternative" is the simple approach:

sub new { my $class = shift; my $self = { ... }; bless $self, $class; }
None of the extra cut-n-pasted stuff to make $instance->new do anything in particular, because as I said in my quoted item above, it's wrong to two-thirds of the audience, and therefore is dangerous.

If that's confusing to you, I wish you could say what you're missing in a different way, because I'm not getting it.

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