I have a module with multiple subclasses. I'm trying to figure out how 'Role' over these subclasses. I'm unsure of the terminology. I am using perl 5.10, and am wondering if this can be done without the use of a module, or perl6. Any examples would be helpful.
package Test1;
use base 'Example1';
## overrided method
sub getObjectId {
my $self = shift;
my $arg = shift;
return Other::Package::lookupId($arg);
}
1;
package Test2;
use base 'Example2';
## overrided method
sub getObjectId {
my $self = shift;
my $arg = shift;
return Other::Package::lookupId($arg);
}
1;
package Test3;
use base 'Example2';
## overrided method
sub getObjectId {
my $self = shift;
my $arg = shift;
return Other::Package::lookupId($arg);
}
1;