Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Undefined subroutine errors

by shemp (Deacon)
on Oct 25, 2005 at 23:15 UTC ( [id://502897]=note: print w/replies, xml ) Need Help??


in reply to Undefined subroutine errors

It would be helpful to see exactly how these module are including one another. Are they being use'd or require'd? If the modules are packages, are the use or require statements within the packages, or outside of the package declarations?

Also, i may get flamed for this, but it seems like a design flaw to have two modules that depend on each other....flame away!


I use the most powerful debugger available: print!

Replies are listed 'Best First'.
Re^2: Undefined subroutine errors
by GrandFather (Saint) on Oct 25, 2005 at 23:47 UTC

    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.

      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.

Re^2: Undefined subroutine errors
by Anonymous Monk on Oct 25, 2005 at 23:24 UTC
    They are being use'd not require'd.

    Both modules declare their own namespace with package.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://502897]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-25 17:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found