in reply to Re: Undefined subroutine errors
in thread Undefined subroutine errors

I'm sure no sensible person would flame you for suggesting that OP's base problem looks like a design issue. Given that OP seems to have control over all the code involved OP's best option may be to refactor the code to remove the circular dependencies that are implied, or at least move the circular code into a common module so that that nastyness doesn't leak out to pollute other code.

However, assuming that the modules are currently being "used", requiring may fix the issue. OP should take a look at Using a module more than once which has some interesting and pertinent replys.


Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^3: Undefined subroutine errors
by ioannis (Abbot) on Oct 26, 2005 at 00:44 UTC

    Although uncommon, the intentions of OP might not necessary be a design flaw. His situation is similar to C code when we export symbols, not from the library to main, but from plugin to other plugins using the RTLD_GLOBAL with the 2nd parameter to dlopen(), so plugins can have access to the symbols of one another.

    OP has advanced an interesting problem. My efforts so far reveal that the problem is trivially solved by calling the functions with their full package names. It is the import mechanism of Export that fails to make things more convenient and allow us to import all symbols to both namespaces at once.