http://qs321.pair.com?node_id=11114952

feumw has asked for the wisdom of the Perl Monks concerning the following question:

The title might be a little weird but I couldn't sum up better what I want to know.

So I'm working on a macOS. As war as I know /usr/bin/perl is the default perl which comes with the OS. Some people say it's bad and you can't get full usage out of it so they prefer to install perl again via homebrew - The Missing Package Manager for macOS (or Linux).. No matter which perl (default=/usr/bin/perl / or homebrew=/usr/local/bin/perl is "active" for me cpan stays on the same location (/Users/myusername/.cpan). I double checked both with perl -MCPAN -e shell aswell.
How does this work? Does cpan install the Modules into it's own directories and no matter which perl is active, perl is just allowed to access those folders?

On Stackoverflow I found an article about cpan-vs-mcpan-perl saying:
cpan installs for the perl in the shebang (#!) line of the cpan file.
When someone has more than one perl installed on a machine, they sometimes run the wrong copy of cpan, and thus end up installing modules for the wrong instance of perl.
One solution to that would be to specify the full path to the correct cpan file.
perl -MCPAN -e shell is the other solution. It allows you to explicitly specify the install of perl for which you want the modules to be installed.
I'd have assumed I have different locations using perl -MCPAN -e shell.

Let's say I want to split my CPANs having one for the default and one for the homebrew perl. How can I do this?
And does reinstalling a new fresh and clean cpan mean just rm -rf /Users/myusername/.cpan?

I hope I can find some Wisdom here to clear up my minds. Thanks in advice.