| Next | February 2001 | Slide #36 |
It was tempting to have written Person::new like this:
package Person;
sub new {
bless {}, 'Person';
}
If we had, then after this code:
$p = Employee->new();
$p is now a Person, not an Employee
It is very peculiar that Employee->new does not construct an Employee
This call will fail because there is no Person::department:
$p->department('Trite Advice');
| Next | ![]() |
Copyright © 2001 M-J. Dominus |