Trying to use the system Perl on a new Mac Mojave I had some difficulty getting a XML::LibXML module installed from CPAN module but eventually got it working about a week ago. I remember using brew to install the LIBXML2 libs and fiddling with the paths in a few different ways as well as running a few xcode commands to ensure everything at that end was ok.

Step forward a couple of weeks and I come into the same error when trying to install URL::Encode::XS and figured that I should remember enough to get it build but a few hours later I'm still bumbling about.

I'm guessing that one solution is to use a perlbrew Perl build which should help get around the hard access limits to some of the restricted mac directories ( eg /usr/bin etc ) and I kicked things off down this path but I would still like to understand more about why XS modules are so problematic on MacOSX and have some idea of what is required to work around the system constraints.

Secondly, I'd like to be more confident about the best environment for Perl development on a Mac - do most people step away from the system Perl and use Perlbrew or is there an approach or bunch of knowledge that will allow me to work with system Perl and still be able to build modules with Library dependencies?

NB - Cross post in Stack Overflow Answer

To summarise my findings based on responses here etc the best practice would seem to be:

If I've missed anything in my findings update let me know so that I can refer ppl here with more confidence.


In reply to MAC Perl EXTERN.H Make Issues by localshop

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.