|
|
|
|
194 |
package MyClass;
sub new {
my $type = shift; # Get the package/type name
my $self = {}; # Reference to empty hash
return bless $self, $type; # Add and return the class instance
}
sub MyMethod {
print " MyClass::MyMethod called!\n";
}
$myObject = MyClass->new();
$myObject->MyMethod();