Skip Menu |

This queue is for tickets about the Module-Pluggable CPAN distribution.

Report information
The Basics
Id: 45884
Status: resolved
Priority: 0/
Queue: Module-Pluggable

People
Owner: Nobody in particular
Requestors: Ian.Goodacre [...] xtra.co.nz
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.9
Fixed in: (no value)



Subject: errors requiring modules
When option require is set true, modules are required only from the directories in @INC. This can result in errors when requiring modules or surprising versions of modules being loaded when modules exist in multiple locations. Modules are required only from directories in @INC because CORE::require is used to require them and CORE::require only searches @INC - it ignores any directories specified in the search_dirs option. Thus Module::Pluggable can find a plugin module in a directory specified in the search_dirs option and then fail to load it. Alternatively, if a module of the same name exists in one of the directories in @INC then that module will be loaded rather than a module of the same name that exists in one of the directories specified in search_dirs. This might be surprising for users given the documentation that says Module::Pluggable will look in the directories in search_dirs before looking in those in @INC. One option to fix this might be to localize @INC and prepend the directories in search_dirs before calling require to require the module.
On Fri May 08 23:04:08 2009, iang wrote: Show quoted text
> One option to fix this might be to localize @INC and prepend the > directories in search_dirs before calling require to require the module.
Hmm, good point - nice catch. I'll have a fix out soon (I realise 'soon' is a bit redundant given that this bug is 3.5 years old but still ...)
This should now be fixed in commit 37883bd5bb50ff94badbf9bb23b9ab9ec15d2694 https://github.com/simonwistow/Module- Pluggable/commit/37883bd5bb50ff94badbf9bb23b9ab9ec15d2694
Now released as 4.1