Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

How to create relocatable perl 5.20.1 ?

by szabgab (Priest)
on Sep 25, 2014 at 20:40 UTC ( #1102042=perlquestion: print w/replies, xml ) Need Help??
szabgab has asked for the wisdom of the Perl Monks concerning the following question:

As I was building a relocatable Perl I bumped into some problems with some of the values in %Config not automatically being updated. A bit of searching led me to this patch but I could not find anything related to that in the sources of perl 5.20.1.

I described the issue here more in details, but in a nutshell $Config{perlpath} (and a few other entries in %Config) keep pointing to where prefix installed perl, even after I move the installation tree.

Do I need to give some other parameter during the building of perl to change this behavior? Is there some script I need to run after I moved the installation tree?

  • Comment on How to create relocatable perl 5.20.1 ?

Replies are listed 'Best First'.
Re: How to create relocatable perl 5.20.1 ?
by ikegami (Pope) on Sep 26, 2014 at 00:27 UTC

    Do you actually need a relocatable perl, or do you simply want to install Perl somewhere other than the default?

    On a Linux box (which you appear to be using), the latter is trivial using perlbrew, or even manually.

    curl -L +ar.gz | tar xz cd perl-5.20.1 . Configure -des -Dusethreads -Dprefix="$HOME/perl" make make test make install
Re: How to create relocatable perl 5.20.1 ? (
by Anonymous Monk on Sep 26, 2014 at 00:26 UTC

    I think you need to load

    FWIW, IIRC, "relocatable perl" means @INC gets automatically updated, @INC is relative to $^X ... @INC not all of %Config

    Moving the perl always mean %Config had to be updated ... Portable does that updating on the fly

    citrusperl provides a relocateperl which updates %Config permanently

    activestate provides a Installer.bat

    Strawberryperl just does it with Portable (there is a chance there is an updated but who cares :)

      Some excellent pointers there. thanks!

      The is not really what I want here as that would require the users to change their code but I just found an old e-mail thread with kmx in which we talked about this issue. So maybe I misunderstand what Portable does.

      The relocateperl of Citrusperl might do what I need here, but it is written in C and I could not find its source yet.

Re: How to create relocatable perl 5.20.1 ?
by CountZero (Bishop) on Sep 26, 2014 at 08:09 UTC
    Strawberry Perl has several portable zip editions which you can load on a USB-stick or save anywhere on your hard-drive. Their website says: you can move/rename the perl directory and it will still work. Is that what you want to do?


    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics
      szabgab is trying to improve which he maintains :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1102042]
Approved by Perlbotics
Front-paged by MidLifeXis
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2018-03-22 18:55 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (283 votes). Check out past polls.