| Next | February 2001 | Slide #32 |
@ISA = ('Person');
Why is @ISA an array?
It may contain several class names
package Employee;
@ISA = ('Person', 'Security::Agent', 'Programmer');
If $e is an Employee, then $e->languages_known looks first for Employee::languages_known
Then for Person::languages_known
Then in the superclasses of Person
Then in Security::Agent and its superclasses, then in Programmer and its superclasses
Then it gives up
Note Depth-First Search
use base ('Person', 'Security::Agent', 'Programmer');
| Next | ![]() |
Copyright © 2001 M-J. Dominus |