Hail, O Monks.

I'm new to Macintoshes. Mine (Monterey) comes with Perl. I installed Homebrew. I then followed some advice I found somewhere and installed another copy of Perl (probably through Homebrew, but I'm not sure). Now when I run cpanm Array::Compare I'm told

Can't write to /Library/Perl/5.30 and /usr/local/bin: Installing modules to /Users/my_username_here/perl5

and the installation goes through. Then, when I try to use Array::Compare, I'm told

Can't locate Array/Compare.pm in @INC (you may need to install the Array::Compare module) (@INC contains: /opt/homebrew/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0/darwin-thread-multi-2level /opt/homebrew/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0 /opt/homebrew/Cellar/perl/5.34.0/lib/perl5/5.34.0/darwin-thread-multi-2level /opt/homebrew/Cellar/perl/5.34.0/lib/perl5/5.34.0 /opt/homebrew/lib/perl5/site_perl/5.34.0) at -e line 1.

All I want to do is be able to install modules using cpanm and then use them, the way I used to on Windows. What should I do?

Note, I don't mind uninstalling the copy that I installed of Perl and starting over, if that's the best way.

$_="msh210";$"=$\;@_=@{[split//,uc]}[2,0];$_="@_$\1";$\=$/;++$_[0]for$...1;print lc substr crypt($_,"@_"),1,6

In reply to module installation woes on a Mac by msh210

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.