Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

How to create relocatable perl 5.20.1 ?

by szabgab (Priest)
on Sep 25, 2014 at 20:40 UTC ( [id://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?

Replies are listed 'Best First'.
Re: How to create relocatable perl 5.20.1 ?
by ikegami (Patriarch) 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 http://search.cpan.org/CPAN/authors/id/S/SH/SHAY/perl-5.20.1.t +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 ? ( Portable.pm)
by Anonymous Monk on Sep 26, 2014 at 00:26 UTC

    I think you need to load Portable.pm

    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 Portable.pm 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?

    CountZero

    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 http://dwimperl.com/linux.html which he maintains :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1102042]
Approved by Perlbotics
Front-paged by MidLifeXis
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-03-29 07:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found