http://www.perlmonks.org?node_id=1129980

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

Hello,

I have been tasked to move perl binary (along with all the library files) to a different location without doing any compilation. Note that the new location would be on NFS. Is it possible to do such a move?

I understand that the locations of the libraries that are provided during the compilation cannot be changed. Correct me if I am wrong.

Thank you.
  • Comment on Moving perl from one directory to another.

Replies are listed 'Best First'.
Re: Moving perl from one directory to another.
by dave_the_m (Monsignor) on Jun 11, 2015 at 08:03 UTC
    The default location of perl's library files are usually hard-coded into the perl binary at compile time, but can be changed at run time via the PERL5LIB environment var, the -I perl command line switch, or 'use lib' within a script, for example.

    Dave.

      Thank you Dave.

      I will try out this. The only problem is that the change might have to be done in lots of files.

        Not necessarily. You should be able to export the appropriate environment variables in the shell startup script or somewhere simillar (I don't know AIX, so I can't give an accurate suggestion on that).
Re: Moving perl from one directory to another.
by Anonymous Monk on Jun 11, 2015 at 07:53 UTC
      Hi,

      I have to do it on AIX and I don't have the option to compile it.

      Regards, Srinivasan
Re: Moving perl from one directory to another.
by jfroebe (Parson) on Jun 11, 2015 at 14:08 UTC

    This sounds like the need for symbolic links. Move the Perl installation wherever you want and use the symbolic link to point from the old location to the new. No need for messing with environment variables or recompiling Perl.

    Jason L. Froebe

    Tech Blog