in reply to Re: Need help with circular dependencies
in thread Need help with circular dependencies

When I set it up that way, I was getting undefined subroutine errors from other modules that both Company.pm and SnapMirrors.pm use. I'm still trying to track down the errors, since they only appeared when I added the functionality described above. I'll reply with a post-mortem as this unravels. Thanks, Chris
  • Comment on Re^2: Need help with circular dependencies

Replies are listed 'Best First'.
Re^3: Need help with circular dependencies
by GrandFather (Saint) on Jan 31, 2011 at 19:47 UTC

    If you can educate your other team members in the ways of OO you will find that that can resolve many of these sorts of issue. Because you call methods on an object without needing to have it exported you can avoid import conflicts and circular module dependencies. From the perspective of someone using a module there is very little difference between a function call and a member call - just the $obj-> in front generally, and a call to new to create the object.

    If you need any help sorting out simple OO let us know. It really is much easier than you may think.

    True laziness is hard work

      True, I agree. I come from a C++ background, so it's not too hard for me, but the rest of the team is having problems with hashes of hashes, let alone trying to work with OO Perl.

      Part of the reason for my modules was to simplify access to the data structures so the other admins could leverage the data. (Before, everyone would just create lists in their scripts, and then we'd have to maintain all of the lists in all the scripts, instead of one function in one location.)

      It was a big enough fight getting people to realize how important using a module was, so I'm not sure I'm ready for the OO fight. I do agree, though. :)

      Thank you again for all your comments. I really appreciate it.

      Chris