in reply to Re: scripts in relocatable perl
in thread scripts in relocatable perl
Copy this file into your Perl core lib directory:
package CORE::Relocatable; sub import { return if $^O eq 'MSWin32' # or whatever check you deem necessary if (not $ENV{PORTABLE_XL_PERL}) { require FindBin; local $ENV{PORTABLE_XL_PERL} = 1; local $ENV{PERL5LIB} = ''; local $ENV{PERLLIB} = ''; exec("$FindBin::Bin/perl", $0, @ARGV); } } 1
... and have all your scripts
use CORE::Relocatable;
Duh - I don't know whether a relocated Perl on Unix will know where its site/lib directory is, so this might still be a nonstarter :-(
|
|---|