June 2012 Archives

Solving "cpan: command not found" Error in OS X Lion

I ran into an issue while customizing my new MacBook Pro where after installing the first Perl module the CPAN executable simply vanished (or at least appeared to!).

After some digging I discovered that the file permissions for a number of CPAN/Perl scripts had been modified at some point during the module installation and the 'execute' flag removed.

Below are a few of the affected executables in the /usr/bin directory, notice how the 'execute' bit isn't set:

-rw-rw-rw-  35 root   wheel       807 Jul  4 11:52 cpan
-rw-rw-rw-  35 root   wheel       807 Jul  4 11:52 cpan2dist
-rw-rw-rw-  35 root   wheel       807 Jul  4 11:52 cpanp
-rw-rw-rw-  35 root   wheel       807 Jul  4 11:52 cpanp-run-perl
Continue reading Solving "cpan: command not found" Error in OS X Lion.