united states of america usa  linkedinfacebook   Call Us Today: (786) 646-6461

Enable Perl and CPAN on a Mac

We've tried to install a Perl package unsuccessfully on a Mac and, as it turns out, you need to do a few things before you can run CPAN and install packages. Specifically, you need to install developer tools:

xcode-select --install

Once that installs, you should now be able to run cpan and install packages. Make sure cpan runs as a super user (ie sudo):

sudo cpan Tk

Tk is a bad example, because it won't install without X11. X11 has been removed from MacOS in the recent versions and in order to use it, XQuartz package needs to be installed. It can be downloaded from here: https://www.xquartz.org/

Once XQuartz is installed, the above command will work.

ALT is an IT services company, with offices across Canada and United States. ALT is a consulting firm, specializing in IT support, IT consulting and application development.