in reply to Re^2: CPANPLUS custom configurations
in thread CPANPLUS custom configurations
But what is interesting (strace-d), if any such module is found in @INC, the same module is also being loaded from $HOME/.cpanplus first, so the one found in @INC has no effect. A bug? A feature?
The configuration modules are loaded using require. Thus a given module will only be loaded once, even if multiple instances occur in the various directories in @INC, and the first one found in @INC will be loaded. This is standard behavior for require.
While loading configuration modules, CPANPLUS localizes @INC and prepends the user's cpanplus library directory to @INC (on unix systems this is ~/.cpanplus/lib with ~ expanded to the current user's home directory). Thus, as you observed, configuration is loaded preferentially from this directory in the case that a module of the same name also exists somewhere else.
It seems quite deliberate, so I guess it's a feature.
|
|---|