http://qs321.pair.com?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.

Replies are listed 'Best First'.
Re^9: It's a dog, but what kind? (polymorphism , in Perl OO) (!conveyed)
by tye (Sage) on Mar 24, 2004 at 16:55 UTC

    Yes, you aren't getting it (on at least two counts, it appears). Yes, I understood your response and even responded to it. I linked to where I explain why I consider the alternative above to be unacceptable (it makes a simple mistake hopelessly confusing).

    I wasn't particularly terse in my explanations so I won't rehash them further (I doubt I'd be successful in conveying the points to you based on how completely I've failed so far). Maybe some other time we'll be closer to the same "wavelength".

    - tye