It's really easy to create a situation where you cannot have a correct order. For example, if you create a frobnitz() method in Foo that mirrors the frobnitz method in Bar, plus added a copy of the AUTOLOAD in Foo. What's the correct order to use now?

Not as big a problem as you seem to think, since you can predeclare both packages before either of the AUTOLOAD methods appears. In this case, Perl is Flexible Enough (tm). I'm not disagreeing with your advice. I'm just sayin'.

Also, if you put Foo and Bar in their own .pm files, and have have each use the other (*after* its own package statement), things should work out. I have had load order problems with Perl, but never one that was hard to solve.


In reply to Re: Why you shouldn't use the Indirect notation with AUTOLOAD by no_slogan
in thread Why you shouldn't use the Indirect notation with AUTOLOAD by dragonchild

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.