in reply to brew install perl

Building your own Perl is not that hard -- just time-consuming, and a lot of that is just waiting for tests to run should you choose to do them.

  1. Install XCode, if you have not already done so.
  2. Install the XCode command line tools if you have not already done so: $ xcode-select --install.
  3. Decide where Perl should live. Create that directory. For the purposes of the following write-up, call the new directory "the-directory-you-want-Perl-to-live-in". For convenience in running the configure script, also create a bin/ directory under it.
  4. Download the kit from CPAN into a working directory, expand it, and cd to the kit directory.
  5. Configure Perl: $ ./Configure -Dprefix=the-directory-you-want-Perl-to-live-in. Answer a bunch of questions, defaulting almost all of them.
  6. Build Perl: $ make.
  7. Test Perl if desired: $ make test.
  8. Install Perl: $ make install. If you are installing in a system directory you may need to $ sudo make install.
  9. Add the bin/ directory to your PATH.

Installing a system-wide Perl under macOS has become increasingly difficult as Apple places more restrictions on system access. Mine currently lives in /Users/Shared/. You could also put it in your personal directory somewhere.