At the risk of breaking ranks here, I will attempt to help actually answer your question ...

*grin*

Does anyone know how to reliably extract the name of the calling method, so that I can ommit that from the calls to the NEXT method?
While I understand your hesitancy with AUTOLOAD, it would remove this entire problem.

Perhaps we're not talking about the same "problem."

The built-in syntax for an empty wrapper is:

sub compile { (shift)->SUPER::compile(@_) }

The syntax I'm currently using is:

sub compile { (shift)->NEXT('compile', @_) }

What I'm hoping for is to omit the method name and have it picked up from context:

sub compile { (shift)->NEXT(@_) }

All of the AUTOLOADed solutions seem like they'll still require the current method name to be specified:

sub compile { (shift)->SUPER::DISPATCH::compile(@_) }

Admittedly, it's a minor point, but if you're going to have a rule that says that you can't redispatch to a different method name, it seems gauche to make the caller write out the method name again.


In reply to Re^2: Solving the SUPER problem in Mixins with a Dispatch Method by simonm
in thread Solving the SUPER problem in Mixins with a Dispatch Method by simonm

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.