in reply to Learning how to use inheritance...
As for the assignment to @ISA, you are really assigning to @Two::ISA, and you are telling Perl that the class Two inherits the class One. A use statement doesn't set up any inheritance relationship - it just includes code (and run import() if there is one, but that's not relevant in this case).
The fact that the code still runs if you omit the @ISA assignment is that you aren't using the inheritance. The class One has just one method: new, but that method is also defined in class Two. So, One has nothing that Two can delegate to.
Abigail
|
---|