Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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.

In reply to Understanding Perl / Brew Perl and Cpan on macOS by feumw

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2023-02-01 21:49 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (14 votes). Check out past polls.