package MyPackage::Module::ThisFeature;
use base MyPackage::Module;
####
use Test::More 'no_plan';
my $obj = MyPackage::Module::ThisFeature->new();
isa_ok($obj,'MyPackage::Module');
isa_ok($obj,'MyPackage::Module::ThisFeature');
isa_ok($obj,'MyPackage::Module::ThatFeature');
####
perl 01-test.t
ok 1 - The object isa MyPackage::Module
ok 2 - The object isa MyPackage::Module::ThisFeature
not ok 3 - The object isa MyPackage::Module::ThatFeature
####
#!/usr/bin/perl -wT
use strict;
use warnings;
use MyPackage::Module::ThisFeature;
use MyPackage::Module::ThatFeature;
my $obj = MyPackage::Module::ThisFeature->new();
my $result = $obj->this_method();
. . .
####
package MyPackage::Module;
sub new {
. . .
bless $self, $class;
}
sub this_method {
}
sub that_method {
}
1;
package MyPackage::Module::ThisFeature;
use base MyPackage::Module;
sub this_method {
}
sub some_other_method {
}
1;
package MyPackage::Module::ThatFeature;
use base MyPackage::Module;
sub that_method {
}
sub still_another_method {
}
1;