Peculiar perl version issue

Bruce Miller bruce.miller at nist.gov
Wed Jun 12 15:26:38 UTC 2019


[This is motivated by the LaTeXML port,
but is a general question about perl portgroup]

A colleague suggested the clever shebang line
   #!/usr/bin/env perl
as a way to easily allow testing against different
versions of perl, running in sandboxes, etc.
This has worked fine on all systems, so far,
including MacPorts...
That is, until macports installed multiple perl versions!
(MacPorts 2.5.4, on Mojave, 10.14.5, as it were)

So, apparently the perl portgroup replaces shebang
lines that it recognizes with a call to the specific
perl that was specified in the portfile (? is that right?)
And if so, it doesn't recognize the above line,
so it leaves it alone.
Since LaTeXML specifies perl 5.26 (Yes, I know
I need to update it, but that's only a shortterm fix),
and macports is installing both 5.26 and 5.28,
all of LaTeXML's modules go under
   /opt/local/lib/perl5/vendor_perl/5.26
and env perl -v shows
   This is perl 5, version 28...

So; is there a simple way to tell the portgroup
to replace the shebang line? Or some other nice
solution?
(hopefully short of replacing all my shebang lines
with "proper" ones).

(And ideally, I'd avoid the whole version business,
since LaTeXML *should* work with any version of perl
after, I think, 5.10)

Thanks!
bruce


More information about the macports-dev mailing list