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

You are right, we were not. Sorry, only had one cup of coffee when I wrote that (hence the sarcasm and bitterness). However, I have now had more than one cup of coffee and I think this might help you.

#!/usr/bin/perl use strict; use warnings; { package MyObject::Base; sub NEXT { my ($self, @args) = @_; my ($package, $filename, $subroutine); my $i = 1; ($package, $filename, undef, $subroutine) = caller($i); while ($subroutine eq '(eval)' || $filename eq '(eval)') { ($package, $filename, undef, $subroutine) = caller(++$i); } print "NEXT was called from : $subroutine\n"; } package MyObject; our @ISA = ('MyObject::Base'); sub compile1 { (shift)->NEXT(@_) } sub compile2 { eval { (shift)->NEXT(@_) } } sub compile3 { eval { eval { (shift)->NEXT(@_) } } } sub compile4 { my $self = shift; eval '$self->NEXT(@_)' } sub compile5 { my $self = shift; eval 'eval "$self->NEXT(\@_)"' } + sub compile6 { my $self = shift; eval { eval { eval { eval 'eval { eval "\$self->NEXT(\@_)" }' } } } } } MyObject->compile1(); MyObject->compile2(); MyObject->compile3(); MyObject->compile4(); MyObject->compile5(); MyObject->compile6(); __OUTPUT__ NEXT was called from : MyObject::compile1 NEXT was called from : MyObject::compile2 NEXT was called from : MyObject::compile3 NEXT was called from : MyObject::compile4 NEXT was called from : MyObject::compile5 NEXT was called from : MyObject::compile6

-stvn

In reply to Re^3: Solving the SUPER problem in Mixins with a Dispatch Method by stvn
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.