[Pdx-pm] [csieh at fnal.gov: Re: Horribly Broken RHEL5/SL5 Perl]

J. Shirley jshirley at gmail.com
Tue Aug 26 10:46:33 PDT 2008


On Tue, Aug 26, 2008 at 10:27 AM, Keith Lofstrom <keithl at kl-ic.com> wrote:
>
> I spoke too soon.  Sigh, no distro support on this one.  OK,
> for the complete Perl noob, how does one go about maintaining
> two versions of Perl on a machine, one for "system" and one
> for everything else including serving web pages?
>
> Understandable, updated, robust and secure is good.  I fear
> the only option is a large learning and maintenance burden.
>
> Keith
> [snip]

I would highly recommend looking at local::lib, as it lets you be
remarkably flexible not only with multiple perls, but also CPAN and
just doing a "perl Makefile.PL && make && make test && make install".

The way I do this, and my method is probably not the best for standard
usage, is to simply grab a perl I want (lets say perl 5.10) and want
to build it in /opt/perl/perl-5.10

Uncompress the tarball, then:
./Configure -des -Dprefix=/opt/perl/perl-5.10
make && make test && make install

Now, you have a perl in /opt/perl/perl-5.10 and you can create a
symlink in your path, or simply set that in your PATH var.

The next important step is to always invoke perl with:
#!/usr/bin/env perl
Do not use:
#!/usr/bin/perl

Now, once you have that, follow the instructions for local::lib to get
yourself a fully encapsulated dir to install your modules (you can
also put this in some other location other than ~/perl5 - read hte
pod)

Then, invoking your specific non-system perl with env and having a
setup local::lib will get you everything you need.  Including full
CPAN support with nothing breaking, and a fully functional system perl
that still resides at /usr/bin/perl (or wherever).

Just remember to keep track of which perl you are invoking, but it's
really not too difficult to do that.

-J


More information about the Pdx-pm-list mailing list