in reply to Using a module twice giving a problem

There is no problem is what you presented to us.

Do you perhaps change package at some point?

package One; ... use MyModule; ... package Two; ... functionOne() ...

&One::functionOne exists, but &Two::functionOne doesn't.

Replies are listed 'Best First'.
Re^2: Using a module twice giving a problem
by Anonymous Monk on Aug 15, 2011 at 04:03 UTC
    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.

      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.

      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".