in reply to A Class inside a Perl script?
You're package is named test, but you are blessing into Person.
You should use the following constructor in your packages, which takes care of inheritance too.
sub new { my $proto = shift; my $class = ref $proto || $proto; my $self = {}; # ... # ... bless $self, $class; return $self; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: A Class inside a Perl script?
by GrandFather (Saint) on Jun 02, 2009 at 11:37 UTC |