|
|
|
|
195 |
package MySubClass;
@ISA = qw( MyClass );
sub new {
my $type = shift; # Get the package/type name
my $self = MyClass->new; # Reference to parent's hash
return bless $self, $type; # Add and return the class instance
}
sub MyMethod {
my $self = shift;
$self->SUPER::MyMethod(); # Call the parent method if desired
print " MySubClass::MyMethod called!\n";
}
$myObject = MySubClass->new();
$myObject->MyMethod();