Mutual Circular Module Dependencies

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
How do I avoid problems with modules that depend on each other -
without getting function redefined errors etc.

e.g. I have two classes in two modules. Once called country one called
town. Both call functions in the other so both have to 'use' the other
- which causes the errors. I could turn off strict and warnings but
I'd rather fix it properly.

Is there a solution?

Thanks in advance,


P.S. Please I'm not interested in an argument about whether I should
have the mutual dependency in the first place - if you want that start
another thread!

Re: Mutual Circular Module Dependencies

In article

Quoted text here. Click to load it

What errors? Can you post a short program that demonstrates the problem
you are having? It is possible for two modules to 'use' each other.
Perl will 'use' a module only once.

Possible solutions:

1. Combine the two modules into one.
2. Extract common members or methods and put them in a third module.

Jim Gibson

 Posted Via Premium Usenet Newsgroup Services

Site Timeline