in reply to Why you shouldn't use the Indirect notation with AUTOLOAD

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.

  • Comment on Re: Why you shouldn't use the Indirect notation with AUTOLOAD