package MyClass; use strict; sub new($) { my $invocant = shift; my $class = ref($invocant) || $invocant; # object or class name my $self = { }; bless($self, $class); return $self; } sub HelloWorld($) { my $self = shift; print "Hello, World!\n"; } 1;