Re: *more* relocatable perl

Gianni Ceccarelli via perl5-porters <[email protected]> Tue, 21 Jul 2026 13:20:30 +0100
Newsgroups gmane.comp.lang.perl.perl5.porters
Message-ID <20260721132030.77c2cf3c@exelion>
On Tue, 21 Jul 2026 14:08:56 +0200
Leon Timmermans <[email protected]> wrote:

> The problem with such an approach is that shebang lines don't change
> when you relocate your perl, so all scripts will suddenly break.
>=20
> We don't really have a good solution for that, though I can think of
> some terrible solutions (involving a little bit of shell at the top
> of every perl script that finds the right perl and executes that).

MakeMaker tries=E2=80=A6
https://metacpan.org/dist/ExtUtils-MakeMaker/source/lib/ExtUtils/MM_Unix.pm=
#L1323-1326

on most UNIXy things, `-Dstartperl=3D'/usr/bin/env -S perl'` is also a
decent choice

This is a bit of a bootstrapping problem, though: we don't yet have a
running perl (to interpret paths relative to), so whatever mechanism
we use, it can't depend on perl itself

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