Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
I have written a perl module (package XYZ) that contains a function named test that does some testing of its internals. The module tests fine on its own. The module is used as part of a larger framework. But when I require the module from the larger framework, I get "Subroutine test redefined at XYZ.pm line 123...". I presume this is because the parent included a module that exported a function called test which is then running into my function. I am confused by perl's namespace handling, but my experience is with use, not require, so maybe that's the issue.
My module's 'test' function is not exported; but clearly a conflict is occurring when I interface with the larger structure.
Is there a way to find where the conflict is coming from? Where is 'test' originally defined? Aside from renaming my package's method, is there a way to avert the namespace conflict wiht require?
Any help is greatly appreciated!
Humbly yours,
A
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to find the original sub definition
by Anonymous Monk on Dec 22, 2010 at 19:39 UTC | |
by Anonymous Monk on Dec 22, 2010 at 19:51 UTC | |
by Anonymous Monk on Dec 22, 2010 at 19:54 UTC |