[Chicago-talk] 2 subclasses or Multiple inheritance

Ed Summers ehs at pobox.com
Sat Mar 20 12:39:00 CST 2004

On Sat, Mar 20, 2004 at 10:40:43AM -0600, me at heyjay.com wrote:
> And I understand what you say, but at present it seems like my base class
> would be:
> package My::Broker;
> 1;

You might want to consider:

    package My::Broker;

    sub connect {
        croak( "subclasses must implement connect()" );

    sub disconnect {
        croak( "subclasses must implement disconnect()" );

    sub quote {
        croak( "subclasses must implement quote()" );


Kind of like an interface class in Java. Of course you'll still get an 
error when calling a subclass that doesn't define the methods. But if you
add a bit of pod, the extra information might prove handy 6 months from now 


More information about the Chicago-talk mailing list