Re: *more* relocatable perl

[email protected] (Dan) Tue, 21 Jul 2026 15:14:25 -0400
Newsgroups perl.perl5.porters
Message-ID <CABMkAVX0Ov2sMuCoNXA7nGQdxr4REZxuYtnFgeo72KMHWND20w@mail.gmail.com>
--0000000000007962c0065723d583
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 21, 2026 at 3:01=E2=80=AFPM Sam Kington <[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.
>
>
> Most code I write says #!/usr/bin/env perl rather than hard-coding an
> executable location.
>

That is fine for individually distributed scripts or those that have their
own dependency management, but not for scripts that are expected to be
installed with their dependencies and won't work when run with an arbitrary
perl, such as core or CPAN scripts.

-Dan

--0000000000007962c0065723d583
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><span style=3D"background-color:transpare=
nt">On Tue, Jul 21, 2026 at 3:01=E2=80=AFPM Sam Kington &lt;<a href=3D"mail=
to:[email protected]">[email protected]</a>&gt; wrote:</span></div>=
<div class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204=
,204);padding-left:1ex"><div><blockquote type=3D"cite"><span style=3D"font-=
family:Palatino-Roman">The problem with such an approach is that shebang li=
nes don&#39;t change when you relocate your perl, so all scripts will sudde=
nly break.</span><br></blockquote><div><div dir=3D"ltr" style=3D"font-famil=
y:Palatino-Roman;font-size:14px;font-style:normal;font-variant-caps:normal;=
font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text=
-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><=
div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_quote"><div><br></div>=
<div>Most code I write says #!/usr/bin/env perl rather than hard-coding an =
executable location.</div></div></div></div></div></div></div></blockquote>=
<div><br></div><div>That is fine for individually distributed scripts or th=
ose that have their own dependency management, but not for scripts that are=
 expected to be installed with their dependencies and won&#39;t work when r=
un with an arbitrary perl, such as core or CPAN scripts.</div><div><br></di=
v><div>-Dan=C2=A0</div></div></div>

--0000000000007962c0065723d583--