Mac OSX comes pre-installed with Perl. This is how you install CPAN modules into the bundled Perl. Don’t know what Perl or CPAN is? This article isn’t for you. 😛
It needs to be done as root, so use sudo.
- Open Terminal.
- Launch the CPAN shell and enter the password when requested:
sudo perl -MCPAN -e "shell"
- Download the CPAN library you want to install (example is Mac::iTunes::Library):
get Mac::iTunes::Library
- Install the library:
install Mac::iTunes::Library
- Exit the CPAN shell.
q
Now you can include the module in your Perl application as so:
use Mac::iTunes::Library;
Pingback: OSX, Perl, Curses, and @INC | Unfinished Bitness