in reply to Multiple instances of the same base class

I's probably worth noting that your code as-is is halfway between "has-a" and "is-a". I think you do want "is-a", as the other posters have noted. If it were the case that you might at a later date want to delegate method calls to a different base class, you'd do something like this:
package BasicX::AAA1; sub new { my($class, $delegate) = @_; my $self = {}; bless $self, $class; $self->delegate($delegate || BasicX->new()); return $self; } sub delegate { my $self, $new_delegate_instance) = @_; $self->{_delegate} = $new_delegate_instance if defined $new_delega +te_instance; return $self->delegate; } sub delegated_method { my $self = shift; if $self->delegate->can('delegated_method') { $self->delegate->delegated_method(); } else { # handle it yourself } }
So now the instance has a instance of the delegate, and decides to pass control off to it as appropriate. If you have a standard subclass "is-a" relationship; the subclassed methods always have to resolve to the parent class. If you have a delegated "has-a" relationship, then any given instance of the class can be set up to have a delegate to handle methods selectively - and that delegate can be any class you want, as long as it can execute the delegated method. Also note that you can, with this setup dynamically change the delegate after the "subclass" is instantiated.