Re: *more* relocatable perl

Gianni Ceccarelli via perl5-porters <[email protected]> Sat, 18 Jul 2026 22:20:43 +0100
Newsgroups gmane.comp.lang.perl.perl5.porters
Message-ID <[email protected]>
Again, I have made it work, I'm asking =C2=ABdoes it make sense to do for
binary paths what we're already doing for library paths, in the core
perl distribution?=C2=BB

On 2026-07-18 Leon Timmermans <[email protected]> wrote:
> I suspect you can make this work by using the usesitecustomize
> feature to monkeypatch various %Config values. %Config can be
> monkeypatched by (ab)using its tied value.

I didn't want to go that route because it would have loaded Config.pm
in every process (not a big deal but annoying)

Instead I patched Config.pm itself, after building perl but before
tar-ing it up:

I replace `sub FETCH {` with:

```
sub FETCH {
    my ($self, $key) =3D @_;
    my $v =3D $self->_orig_fetch($key);
    return undef unless defined $v;
    my $replacement =3D ($^X =3D~ s{/bin/perl$}{}r);
    $v =3D~ s{/path/to/where/I/built/perl\b}{$replacement}g;
    return $v;
}
sub _orig_fetch {
```

--=20
	dakkar - <Mobilis in mobile>
	GPG public key fingerprint =3D A071 E618 DD2C 5901 9574
	                             6FE2 40EA 9883 7519 3F88
	                    key id =3D 0x75193F88