in reply to Psycho AUTOLOAD question

There is a typo in the above code. It's just pseudo-code representative of the problem, so typos above don't matter.

If the pseudocode is fleshed out to be runnable it doesn't exhibit any problems. The problem seems to lie in the fact that the call $self->wrap_B($sub, @args) in my real code is being interpreted as a subroutine.

For the sake of demonstration, here's the real code:

sub mediate { my ($self, $sub, $type, @args) = @_; if ($type eq 'A') { $self->mediate_action($sub, @args); } elsif ($type eq 'D') { $self->mediate_document($sub, @args); # 366 } elsif ($type eq 'O') { $self->mediate_operation($sub, @args); } elsif ($type eq 'P') { $self->mediate_property($sub, @args); } else { die "What in the ...?"; } }

When I attempt to run the offending code, the line marked above causes recursion and I get, Use of inherited AUTOLOAD for non-method Contentment::Mediator::XSLT::mediate_document() is deprecated at {long-path}/Mediator.pm line 366. This is just plain screwy--unless I misinterpret the meaning of this error. As I understand it, this error only comes up when it sees a plain subroutine call--that is, no invocant.

There is no way line 366 shouldn't be interpreted as a method. There aren't any syntax errors in any related module. Why in the world does Perl think 366 is a plain subroutine call rather than a method call? Even interpreted as a plain sub, it is ignoring the definitions of mediate_document that are in each of Contentment::Mediator and Contentment::Mediator::XSLT. What can I do? I'm about to comment the code in huge sections to see if I can narrow the issue, rewrite the modules entirely, or work out a different solution.