in reply to Re: Using a module twice giving a problem
in thread Using a module twice giving a problem

What you say is perhaps the likely explanation as the module does get loaded. I am weary about the structure of my code and would need to look at it more closely. For now, I am getting around this by explicitly naming the package in the function call (&MyModule::functionOne).

Does explicitly naming the package name in the function call have its disadvantages?

Thank you very much for help.

  • Comment on Re^2: Using a module twice giving a problem

Replies are listed 'Best First'.
Re^3: Using a module twice giving a problem
by syphilis (Archbishop) on Aug 15, 2011 at 04:11 UTC
    Does explicitly naming the package name in the function call have its disadvantages?

    Only in that it means you have to do extra typing.
    If calling it that way works but calling it as functionOne produces the error you reported, then that's a clear indication that you've managed to disable the exporting of that function.

    Btw, the general advice is that you should delete the "&" and call the function as MyModule::functionOne

    Cheers,
    Rob
      Thank you.
Re^3: Using a module twice giving a problem
by ikegami (Patriarch) on Aug 15, 2011 at 09:46 UTC

    Some even qualify names when they don't have to, to show the origin of the function.

    You don't actually need the & and in fact shouldn't use it. I wrote "&One::functionOne" as short hand for "sub One::functionOne".