http://www.perlmonks.org?node_id=1224716

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

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.