Yuck, Yuck and triple yuck.
Yes, agreed.

I have a script XXX, written as a module that can be inherited from. A second script YYY inherits from XXX, but doesn't want to call XXX->setup. YYY does need to call the grandparent WWW->setup.

As YYY needs other methods from both, it's not clear how to manage this generically in a large code environment, where modules are run as scripts, but may also be inherited from in the future.

If the grandparent's name changes, or the number of intervening parents to skip changes, code will need updating. Perhaps it would be better in the grandparent's new to register some value for its children to reference, to know the name of the "interesting" ancestor?

-QM
--
Quantum Mechanics: The dreams stuff is made of


In reply to Re^2: Call Grandparent Method, Skipping Parent by QM
in thread Call Grandparent Method, Skipping Parent by QM

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.