[Mpls-pm] Indirect reference/inheritance?

Chris cpj1 at visi.com
Wed May 24 12:45:59 PDT 2006


Okay, I have 2 classes, one being a subclass of the other.

package A

sub foo {
return;
}

package B
use base(A);


Package A has a subroutine that *should* manipulate a variable in the
namespace of the involking object.

That is, if B is a subclass of A, and B has %Foo, the subroutine in A
should manipulate %B:Foo.

However, my attempt at an indirect reference is failing.

$class=ref($object)
$var=$class."::Foo";

foreach $k (keys(%{$var}))
{
	# do stuff
}

I'm stuck with perl 5.8.0 on this one.

Any ideas what I'm screwing up?

--------------------
Christopher Josephes
cpj1 at visi.com


More information about the Mpls-pm mailing list