This does not propagate properly across perl invocations like local::lib's stuff does. It can't. It's only a module import, so it only affects the specific perl VM instance in which you load and import() it.

If you want to cascade it across invocations, you can set the PERL5OPT environment variable to '-Mlib::core::only' and it'll sort of work. But be aware that taint mode ignores this, so some modules' build and test code probably will as well.

You also need to be aware that perl's command line options are not processed in order - -I options take effect before -M options, so

perl -Mlib::core::only -Ilib

is unlike to do what you want - it's exactly equivalent to:

perl -Mlib::core::only

If you want to combine a core-only @INC with additional paths, you need to add the additional paths using -M options and the lib module: