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.


In reply to Re: Psycho AUTOLOAD question by hanenkamp
in thread Psycho AUTOLOAD question by hanenkamp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.