-   Linux - Software (
-   -   Perl installation in custom location (

rohit.dhaval1 05-11-2011 09:48 AM

Perl installation in custom location

I have an requirement of installing perl in custom location (NFS share that will be mounted on many machines).


suppose '/usr/perly' is the NFS share, perl will be invoked as /usr/perly/bin/perl

I require all the libraries to be created on the same share so that no local libraries are referred. Also, I need hundreds of modules installed in the same location.

How do I do it with CPAN method?

I found this link useful, can you please suggest if this works.

sundialsvcs 05-11-2011 04:09 PM

Probably the best source of information is to Google on Perl installation "as a non-root user."

When Perl is asked to look for a package, it walks down a list ('@INC') looking for it. When 'cpan' is used to install a package, it uses its "configuration" information to know where to put it.

Personally, what I would do here is to establish one "authoritative repository" of what the CPAN libraries should contain for all the various computers, and then, on each of them, I would 'rsync' the data to a local drive. Perl will make constant reference to the directories that are on its '@INC' list, and, quite frankly, I would not advise that they be NFS (Zzzz....) shares...

rohit.dhaval1 05-12-2011 09:48 AM


Thanks for reply,

I found below paragraph in 'perldocs'.. I could install newer perl in total different location without disturbing current perl versions.


=head2 Maintaining completely separate versions

Many users prefer to keep all versions of perl in completely
separate directories. This guarantees that an update to one version
won't interfere with another version. (The defaults guarantee this for
libraries after 5.6.0, but not for executables. TODO?) One convenient
way to do this is by using a separate prefix for each version, such as

sh Configure -Dprefix=/opt/perl5.12.3

and adding /opt/perl5.12.3/bin to the shell PATH variable. Such users
may also wish to add a symbolic link /usr/local/bin/perl so that
scripts can still start with #!/usr/local/bin/perl.

Others might share a common directory for maintenance sub-versions
(e.g. 5.10 for all 5.10.x versions), but change directory with
each major version.
Though it has solved major problems for me, I still have some issues.

When I search for man pages for perl, it is showing pages meant for older perl version.

So situation is,


#perl -v
This is perl 5, version 12, subversion 3 (v5.12.3) built for x86_64-linux

And Man pages are,

#man perl
The Perl motto is "Thereās more than one way to do it." Divining how many more is left as an exercise to the reader.

The three principal virtues of a programmer are Laziness, Impatience, and Hubris. See the Camel Book for why.

perl v5.8.8 2006-01-07 PERL(1)

How do I set manpath during compile time?
Is there a way I can copy man pages meant for NEWER perl version to location where OLD perl man pages are kept, without disturbing anything?

I cannot ask people to add new manpath to their profile file.

Please suggest on this.

All times are GMT -5. The time now is 02:02 PM.