S
surf
I'm new at trying OO in perl and somewhat rusty on OO in general, but
is there a limitation here ? Below I call foo2() from a subclass.
foo2() in the base class calls foo3(). Since my instance is the
subclass I think it should call the subclass foo3() but it calls the
base class. If there isn't a way to do this, I would think perl is
lacking
in OO features, am I wrong ?
package A;
sub foo2 {
print("Inside A::foo\n");
foo3();
}
sub foo3
{
print("foo3 A\n");
}
package B;
@ISA = (A);
sub foo3
{
print("foo3 B\n");
}
sub foo {
print("Inside B::foo\n");
}
package main;
B->foo2();
is there a limitation here ? Below I call foo2() from a subclass.
foo2() in the base class calls foo3(). Since my instance is the
subclass I think it should call the subclass foo3() but it calls the
base class. If there isn't a way to do this, I would think perl is
lacking
in OO features, am I wrong ?
package A;
sub foo2 {
print("Inside A::foo\n");
foo3();
}
sub foo3
{
print("foo3 A\n");
}
package B;
@ISA = (A);
sub foo3
{
print("foo3 B\n");
}
sub foo {
print("Inside B::foo\n");
}
package main;
B->foo2();