Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'don't use CPAN for /usr/bin/perl' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
don't use CPAN for /usr/bin/perl
Authored by: mzs on Jul 17, '09 12:35:38PM

I'm not sure whether you are or are not, but it is worth a warning.

Only use it with a perl you install somewhere else. Apple updates the perl installation under /usr and you do not want to modify that yourself or else things will get mismatched and you will end-up with a broken system perl installation that is hard to fix.



[ Reply to This | # ]
don't use CPAN for /usr/bin/perl
Authored by: CarlRJ on Jul 17, '09 02:55:37PM
Only use it with a perl you install somewhere else. Apple updates the perl installation under /usr and you do not want to modify that yourself or else things will get mismatched and you will end-up with a broken system perl installation that is hard to fix.

I disagree. Actually, Apple installs all their Perl modules under /System/Library/Perl, and configures Perl specifically so that user-installed modules (such as from CPAN) will install into /Library/Perl. I've been using it this way since Jaguar, and don't recall any significant problems.

One caveat, rather than doing the usual make modulename from the CPAN shell, I do a get modulename instead, and then (outside of the CPAN shell) I cd into the corresponding directory under ~/.cpan/build and, instead of the customary perl Makefile.PL, I do "perl Makefile.PL INSTALLBIN=/usr/local/bin INSTALLSCRIPT=/usr/local/bin INSTALLSITEMAN1DIR=/usr/local/man/man1 INSTALLSITEMAN3DIR=/usr/local/man/man3", in order to get man pages and such to go under /usr/local, following this with the usual make, and make test, and sudo make install. This may be overkill, as a) I haven't looked at the details in a while, but b) I tend to be a control freak about what gets installed and where.

I agree that normally one should not mess with Apple-supplied directories/files, but in this case, it's pretty clear that they intended user-installed Perl modules to go into /Library/Perl.



[ Reply to This | # ]
don't use CPAN for /usr/bin/perl
Authored by: mzs on Jul 20, '09 08:30:38AM
That's all great in theory but in practice it does not work:

http://www.macosxhints.com/article.php?story=20090219082024982

http://www.theregister.co.uk/2009/02/16/apple_update_perl_breakage/

There is blame to go around to all parties (like doing what you say is essentially impossible do to the way module paths work in perl) but the rule of thumb is that for the system installation of perl, only use the vendors packages for that (that goes for linux distros as well) and use another perl install for everything else. The main reason for this is all the perl scripts that are from your vendor which you do not want to break with a newer unexpectedly incompatible version of something or other.

[ Reply to This | # ]
don't use CPAN for /usr/bin/perl
Authored by: CarlRJ on Jul 21, '09 12:53:37AM
That's all great in theory but in practice it does not work ... There is blame to go around to all parties (like doing what you say is essentially impossible do to the way module paths work in perl)

Uh, look, are you sure you understand the definitions of the words "theory" and "practice"? I've been using Perl this way for the past half dozen years (on the Mac, that is -- I've been programming in Perl on various platforms since the early 90's) and it has been working just fine for me in practice. I'm not looking to have an argument, but please don't tell me that something I have been doing can't be done.



[ Reply to This | # ]
don't use CPAN for /usr/bin/perl
Authored by: robleach on Jul 20, '09 10:21:36AM

Thanks for the tip. I haven't had any problems. I used to maintain a separate perl installation, but deviated from that awhile back with my newest computer. I personally don't see a whole lot of risk, but I'll agree that your suggestion is a good thing and could prevent problems.

Note, if you have your perl command aliased or your separate perl install is earlier in your path than apple's, you may use my hint as written. Note thought that if you use sudo, the alias/PATH of the super user is the one that will be used, so it would be easiest to supply the absolute path to your own perl installation.

Rob



[ Reply to This | # ]