Forum Moderators: coopster & phranque

Message Too Old, No Replies

More than one version of Perl

Problems with multiple versions of Perl on one server

         

FatBob

2:08 pm on Jun 14, 2003 (gmt 0)

10+ Year Member



Hi

I have ended up with a few versions of Perl on one server - a couple of 5.005x version and 5.8.

The webserver (Apache) is using one of the 5.005 version but the command line is using Perl 5.8.

Problem is when I install modules using CPAN they are being stored in the 5.8 libraries - how can I change the @INC for 5.005 to include the 5.8 libraries?

Or is there a better way? (I keep hearing of problems with 5.8 so I'd rather not remove the 5.005)

Thanks in advance

Storyteller

9:47 pm on Jun 14, 2003 (gmt 0)

10+ Year Member



While there're ways around it (though can't remember a user-friendly one), I'd certaintly suggest upgrading. 5.005 had no less problems than 5.8. The reason you're not hearing about them is probably because very few people still use it ;)

ShawnR

3:53 am on Jun 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi FatBob & welcome to WebmasterWorld!

PPM has a 'Target' command where you can set the target for package downloads. Look in your perl documentation for PPM. What platform ('nix or Windows)?

You say 'Apache is using one of the 5.005 version'. Apache uses whatever program is specified by the #! line of the script, so you can change that by changing your script. To be honest, this is not a feature of Apache I like for Windows platforms (although it is reasonable and standard practice for 'nix platforms), so if you are talking about a Windows platform, and your Apache is configured to ignore the!# line and use a specific version of perl to process your scripts, I'd sure be interested to find out how you did that.

Shawn

amoore

4:03 am on Jun 15, 2003 (gmt 0)

10+ Year Member



You can also call whichever perl from the command line you like. For instance, use "/usr/local/bin/perl -MCPAN -e shell" or perhaps "/usr/bin/perl5.8 -MCPAN -e shell" to install stuff using CPAN.

FatBob

7:11 pm on Jun 15, 2003 (gmt 0)

10+ Year Member



Many thanks for everyone for their help.
The reason everything wasn't upgraded to Perl 5.8 was due to the need to use an OpenPGP module that wouldn't not work with 5.8

BCMG_Scott

2:29 pm on Jun 16, 2003 (gmt 0)

10+ Year Member



There is a module provided with perl called lib.pm that allows you to manipulate @INC.

lib - manipulate @INC at compile time

=head1 SYNOPSIS

use lib LIST;

no lib LIST;

=head1 DESCRIPTION

This is a small simple module which simplifies the manipulation of @INC
at compile time.

It is typically used to add extra directories to perl's search path so
that later C<use> or C<require> statements will find modules which are
not located on perl's default search path.

You can also do:

BEGIN { unshift(@INC, LIST) }

Scott Geiger