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();
In reply to Re: Learning how to use inheritance...
by CombatSquirrel
in thread Learning how to use inheritance...
by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |