Tuppence has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Monks,

I am a $self that has a ->request, which is another object that has a ->client.

I am trying with Class::MethodMaker to make $self->client be $self->request->client

I have use Class::MethodMaker forward => [request => 'client'];

but when I try to call $self->client it says it cannot find the method in my package. Am I just horribly confused or am I doing something wrong?

Thanks in advance for all help, I can't believe I'm here asking this..

Update:This is Class::MethodMaker version 1, version 2 is renamed to Class::MakeMethods

Update2:Problem solved. Reading of module source showed Class::MethodMaker docs are incorrect, it needs use Class::MethodMaker forward => [request => ['client']]

Replies are listed 'Best First'.
Re: Class::Methodmaker with forward methods
by qq (Hermit) on May 24, 2004 at 22:37 UTC

    Update:This is Class::MethodMaker version 1, version 2 is renamed to Class::MakeMethods

    Can't answer your question, but Class::MakeMethods (whose author is simonm) is not version 2 of Class::MethodMaker, but a dfifferent project.

    qq

Re: Class::Methodmaker with forward methods
by simonm (Vicar) on May 24, 2004 at 21:22 UTC
    Are you using version 2.0 of Class::MethodMaker, or version 1?

    It's been overhauled recently and I'm not sure that the backwards-compatibility layer is complete...