cLive ;-) has asked for the wisdom of the Perl Monks concerning the following question:

Never seen this one before...

I'm digging through an issue in a pile of spaghetti code. It is very old, very cluttered and full of "interesting surprises".

One issue I'm trying to debug now is that, by adding a use statement for a module to another, I get an error of:

Tried to use 'Module::Name'; Error: "method_name" is not exported by the Module::Name module

Looking through the use statements of modules used, I see some modules that appear to have nested use statements, eg:

package Module::A; use Module::B; package Module::B; use Module::A;

The methods that are failing are in @EXPORT_OK (this works as expected when using the module on its own.

I note that some modules use 'require Exporter' and others 'use base'.

Basically, apart from stripping the modules down to skeletons, is there a quicker way of getting to the root of this issue?

EDIT: Found the issue. Two modules export the same function name. It looks like this was the first time both modules had been included in the same app, and that the use statement was just copy/pasted even though imported method wasn't used. Removing Exporter from the lesser used module... Eurgh...