[Mpls-pm] Indirect reference/inheritance?

Brett DiFrischia orderthruchaos at gmail.com
Wed May 24 13:35:45 PDT 2006


How did you declare %Foo?  If you used 'my' or 'local', %Free won't be in
the namespace for the inherited class.  Make sure you are using 'our'.

Brett

PS  Sorry, Josh, didn't mean to send that to only you.

On 5/24/06, Chris <cpj1 at visi.com> wrote:
>
>
> 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
> _______________________________________________
> Mpls-pm mailing list
> Mpls-pm at pm.org
> http://mail.pm.org/mailman/listinfo/mpls-pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/mpls-pm/attachments/20060524/3a23d39e/attachment.html 


More information about the Mpls-pm mailing list