in reply to Accessing a module's method without causing circular dependency

Have you just tried it? What error do you get?

In short, there's no problem with modules using one another (as per your description):

package A; use C; sub new { return bless {}, $_[0]; } sub execute { print "A::execute()\n"; } sub getCSVHandle { my $c = C->new(); return $c; } 1; ----- package C; use A; sub new { return bless {}, $_[0]; } sub munge { my $a = A->new(); $a->execute(); } 1; ----- #!/usr/bin/perl use A; my $a = A->new(); my $c = $a->getCSVHandle(); $c->munge(); # prints "A::execute()"
  • Comment on Re: Accessing a module's method without causing circular dependency
  • Download Code