Phantom123 has asked for the wisdom of the Perl Monks concerning the following question:

needed to install a clean version of perl on my Mac computer running on Mac OS X Snow Leopard. first i installed macports. (www.macports.org) for snow leapord (using the dmg file):

https://distfiles.macports.org/MacPorts/

(This file was what i used to install on my computer: MacPorts-1.9.2-10.6-SnowLeopard.dmg)

Then next i tried to installed the perl source code for mac os x from the official site.

http://www.perl.org/get.html#osx

downloaded the file: perl-5-2.14.2.tar

Next untar the downloaded file:

tar xzvf perl-5-2.14.2.tar

then typed the following command:

sudo port install perl5

and got this message:

dlopen(/opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib, 10): Li +brary not loaded: /usr/lib/libcurl.4.dylib Referenced from: /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dyli +b Reason: Incompatible library version: Pextlib.dylib requires version 7 +.0.0 or later, but libcurl.4.dylib provides version 6.0.0 while executing "load /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib" ("package ifneeded Pextlib 1.0" script) invoked from within "package require Pextlib 1.0" (file "/opt/local/bin/port" line 39)

(The above command actually worked for me on a Mac OS X Lion computer albeit i did get a couple of warnings.)

so then i typed the commands given in the README file for installation:

./Configure -des -Dprefix=$HOME/localperl make test make install

This works fine and i see a clean version of perl installed in a sub-directory called localperl. The problem is that when i type

which perl in the command line it keeps pointing to the native installation of perl. That is, on typing which perl in command line, i get /usr/bin/perl

how do i get it to point to the clean version of perl which i had installed since i wish to install a software which is dependent on Perl and also a few additional CPAN modules which i will need to install on the clean version of perl i have downloaded as well. As i understand i should retain the native Perl because some of my system files are dependent on it.

Please help, Monks!

Replies are listed 'Best First'.
Re: installing clean version of Perl on Mac Snow leopard problems
by brx (Pilgrim) on Apr 21, 2012 at 08:28 UTC
    Update: Sorry, I read too fast your question. I'm OT, but you don't have to d/L perl-5-2.14.2.tar (port command do it for you) and you don't have to Configure

    FIY, my $PATH
    echo $PATH /opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/loca +l/bin:/usr/X11/bin



    Original (wrong) answer:
    First, you have native perl with mac osx: perl v5.10.0 on mac osx 10.6.8
    (no need to use macports). But, if want to proffit of macports packages system, you can use a perl package:
    perl5 @5.12.3 lang/perl5 perl5.10 @5.10.1 lang/perl5.10 perl5.12 @5.12.3 lang/perl5.12 perl5.14 @5.14.1 lang/perl5.14 perl5.8 @5.8.9 lang/perl5.8
    Pick your choice. You can also choose some variants:
    perl5.14 has the variants: dtrace: Build with DTrace probes shared: Build shared perl library threads: Build with thread support universal: Build for multiple architectures

    Remember you'll have 2 perls:
    /usr/bin/perl (native) /opt/local/bin/perl (macports)

    Of course, you can also install other distributions or compile your own perl...

    PS: Macports perl installation:  port install perl5
Re: installing clean version of Perl on Mac Snow leopard problems
by Anonymous Monk on Apr 21, 2012 at 06:51 UTC