in reply to Learning how to use inheritance...
Your code in two.pm still runs after removing the @ISA array, because you are overriding the inheritance of the new method by redeclaring it in the second package. Just remove the @ISA part in the above code and you will see where it leads you ;-).#!perl -w package One; sub new { my $class = shift; print "creating object of class $class\n"; bless {}, $class; } package Two; @ISA = ("One"); package main; my $one = One->new(); my $two = Two->new();
|
|---|