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; }
In reply to Re: A Class inside a Perl script?
by arc_of_descent
in thread A Class inside a Perl script?
by harsha.reddy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |