in reply to Why do you need abstract classes in Perl?

An abstract class gives the programmer a chance to inform the compiler that some derived classes share a common interface, and therefore can be used interchangably in some circumstances. You're right, Perl doesn't need that.

But an abstract class gives the programmer a chance to inform the next programmer that some derived classes share a common interface, so that if a new derived class is added, the common methods are expected to be implemented. And, an abstract class can implement common behavior as well, even if it's never instantiated.

-- Randal L. Schwartz, Perl hacker

  • Comment on Re: Why do you need abstract classes in Perl?