Installing addons like Perl/TK and pkdev and all the CPAN modules you want becomes dead easy, with no worry about missing or wrong libraries. Again, without the risk of whacking your OS. And, if you should mess up your private Perl environment, just delete the whole Perl folder, then install it again.
- Install Xcode 5.0.2 or later on your Mac. Xcode is distributed in Mac App Store for free. After installing Xcode, open Xcode and go to Xcode Preferences Downloads, select the Components tab, and click the button next to Command Line Tools to install necessary tools.
- Download Perl from ActiveState: ActivePerl. Download the trusted Perl distribution for Windows, Linux and Mac, pre-bundled with top Perl modules – free for development use.
- Feb 04, 2019 Download and Install Perl. If Perl is not already installed, download the installer and install it yourself. Close the command prompt or terminal session. Go to the Perl download page and click on the Download ActivePerl link for your operating system. If you are on Windows, you may see a choice of ActivePerl and Strawberry Perl.
- To build and install Perl and many of the thousands of useful Perl modules you need to have a compiler. For macOS the easiest way to get a compiler is to install 'Command Line Tools for Xcode' (about 100 Megs), either directly or through Xcode (several Gigs), both available from Apple Developer downloads. Xcode is also available through the App.
A good setup for Perl on macOS:
- Install 'Command Line Tools for Xcode', either directly or through Xcode, both available from Apple Developer downloads (free registration required). Xcode can also be installed through the App Store application.
- Open the Terminal.app (found in Applications -> Utilities) and copy & paste the command below into it (then press the 'return' key):
- Once this is finished (it takes several minutes), quit the Terminal app.
If you are interested in the details of the setup above...
Install Perl For Mac Download
Install Perl For Mac Shortcut
- To build and install Perl and many of the thousands of useful Perl modules you need to have a compiler. For macOS the easiest way to get a compiler is to install 'Command Line Tools for Xcode' (about 100 Megs), either directly or through Xcode (several Gigs), both available from Apple Developer downloads. Xcode is also available through the App Store application. Some versions of the macOS install DVD or SSD come with the 'developer tools', which contains Xcode. Only the 'unix tools' section of Xcode is actually required, no specific version of Xcode is needed, the latest is available directly through the App Store.
- To interact with the command line and run Perl commands, a terminal application is needed. macOS comes with Terminal.app by default, there are alternatives available as well.
- macOS uses .bash_profile, but most other systems (and instructions) look for .bashrc, this code sets up .bash_profile to also run anything in .bashrc. There are other differences but these are not important to us.
- The Perlbrew website lists many of it's advantages. We recommend it here because it separates your installation from the system Perl, this makes upgrading your OS less likely to cause issues with your own Perl setup. It also means you can use a newer Perl than the default one which comes with your OS.
- App-cpanminus provides the
cpanmtool, which makes installing modules very simple to do.