Re: Relocatable Perl
by Corion (Patriarch) on Apr 14, 2017 at 21:38 UTC
|
Windows Perl has always been relocatable, in the sense that you can move perl.exe and its accompagnying files into any directory you like.
The configuration used by Perl and CPAN is a second matter, and they are mostly patched by some script in the distribution. The two main files to look at are Config.pm (and thus, Config_heavy.pl) and CPAN/Config.pm , as these contain absolute paths.
| [reply] [d/l] [select] |
|
|
| [reply] |
|
|
| [reply] |
|
|
|
|
When you say 'they are mostly patched by some script in the distribution', what script in the core perl distribution are your referring to?
I looked for anything in the bin directory that looked like it would relocate the installation, but found nothing. Remember, I am using the raw perl source and building myself.
| [reply] |
|
|
Weird - I was certain that Perl now included its own script to patch the absolute paths in the relevant files, but it seems no such thing is in the Perl core.
You could look at what Portable::Dist does to patch a Perl distribution, or what ActiveState does and replicate that.
| [reply] |
Re: Relocatable Perl
by dasgar (Priest) on Apr 14, 2017 at 22:40 UTC
|
Perhaps you could take a look at how Strawberry Perl handles this for their portable editions.
Also, stevieb has put a considerable amount of work into berrybrew (originally created by David Farrell - see his blog post about it), which is an attempt to be something like perlbrew for Windows by using the Strawberry Perl's portable editions. Depending on what your needs are, you might find berrybrew helpful to use.
| [reply] |
|
|
Nothing with "brew" in the name has anything to do with relocatability
| [reply] |
Re: Relocatable Perl
by FreeBeerReekingMonk (Deacon) on Apr 15, 2017 at 10:06 UTC
|
xammp has served me well in the past. It contains a portable perl directory. Maybe it is useful.
It contains perlIVP, perlivp - Perl Installation Verification Procedure
It will at least verify some basic things.
So maybe perlivp fails if you relocate perl into another directory (make sure you use a clean Windows without perl)
Maybe you could meld/windiff xampp's perl directory with yours...
| [reply] |
Re: Relocatable Perl (use Portable;)
by Anonymous Monk on Apr 14, 2017 at 22:09 UTC
|
| [reply] |
|
|
use Portable;
I doubt that this will be of much use to the OP.
Cheers, Rob
| [reply] |
|
|
:) Why? UTSL you'll find out different
| [reply] |
|
|
I looked at Portable, just like Gábor mentioned here in 2014, http://www.perlmonks.org/?node_id=1102042 and came to the same conclusion.
Portable seems like it will help with scripts and perl changing drive letters and stuff like that. Although I might eventually have that problem, the key issue/question is how can someone install a CPAN module on a relocated perl.
| [reply] |
|
|
Modules
Portable - Perl on a Stick
Provides
CPAN::Mini::Portable in lib/CPAN/Mini/Portable.pm
Portable::Config in lib/Portable/Config.pm
Portable::CPAN in lib/Portable/CPAN.pm
Portable::FileSpec in lib/Portable/FileSpec.pm
Portable::HomeDir in lib/Portable/HomeDir.pm
Portable::LoadYaml in lib/Portable/LoadYaml.pm
Portable::minicpan in lib/Portable/minicpan.pm
But then Agaain Re^3: How to create relocatable perl 5.20.1 ? ( reloc_perl)
| [reply] [d/l] |