How do I replace system perl with MacPorts perl?

Daniel J. Luke dluke at geeklair.net
Sat Jul 26 08:17:53 PDT 2008


On Jul 26, 2008, at 10:50 AM, Erik Norgaard wrote:
> This ought to be straight forward - well, maybe it is:
>
> I have installed macports and perl5.8 into /usr/local/bin,

We recommend that you do not set your macports ${prefix} to /usr/local  
as it can result in some strangeness.

> while the
> system perl remains in /usr/bin - most manuals and scripts expect to
> find perl in /usr/bin so they continue to use the system perl, and
> further this has different @INC so the modules installed with macports
> are not found.

Right, the macports perl is separate from the system perl.

> What is the recommended way of replacing the system perl (leopard)  
> with
> the perl of macports?


You don't want to do that (for one thing, Apple's next softwareupdate  
may upgrade the system perl and overwrite whatever changes you make).

One thing you can do is change your $PATH so that just typing 'perl'  
at the command prompt runs the macports perl. You can change the #!  
line in your perl scripts to either call the macports perl or to look  
up perl in the environment (#! env perl)

--
Daniel J. Luke
+========================================================+
| *---------------- dluke at geeklair.net ----------------* |
| *-------------- http://www.geeklair.net -------------* |
+========================================================+
|   Opinions expressed are mine and do not necessarily   |
|          reflect the opinions of my employer.          |
+========================================================+



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : http://lists.macosforge.org/pipermail/macports-users/attachments/20080726/47dcc75c/attachment.bin 


More information about the macports-users mailing list