in reply to overridden and inheritance

Hi,

Is there a reason why you inherit AppMod to MyAppMod and create an object of AppMod at the same time ? If its just for overriding the subroutines, its not required. Consider the following.

{ package Animal; sub speak { my $class = shift; print "a $class goes ", $class->sound, "!\n" } } # Animal package from before { package Mouse; @ISA = qw(Animal); sub sound { "squeak" } sub speak { my $class = shift; print "a $class goes ", $class->sound, "!\n"; print "[but you can barely hear it!]\n"; } } Mouse->speak;
This will result in
a Mouse goes squeak! [but you can barely hear it!]
Here, Mouse has its own speaking routine, so Mouse->speak doesn't immediately invoke Animal->speak For more details of overriding, have a look at Overriding Methods on CPAN.

Cheers !

--VC

Note: Above example is from perlboot



There are three sides to any argument.....
your side, my side and the right side.