change perl5 from perl5.24 to perl5.26?

Ryan Schmidt ryandesign at macports.org
Tue Oct 31 20:50:00 UTC 2017


On Oct 31, 2017, at 15:41, Murray Eisenberg wrote:

> On 31 Oct2017, at 4:37 PM, Ryan Schmidt wrote:
> 
>> On Oct 31, 2017, at 15:33, Murray Eisenberg wrote:
>> 
>>> On 31 Oct2017, at 4:30 PM, Ryan Schmidt wrote:
>>> 
>>>> On Oct 31, 2017, at 15:28, Murray Eisenberg wrote:
>>>> 
>>>>> On 31 Oct2017, at 4:26 PM, Ryan Schmidt wrote:
>>>>> 
>>>>>> On Oct 31, 2017, at 15:25, Murray Eisenberg wrote:
>>>>>> 
>>>>>>> On 31 Oct2017, at 4:22 PM, Ryan Schmidt wrote:
>>>>>>> 
>>>>>>>> On Oct 31, 2017, at 10:42, Murray Eisenberg wrote:
>>>>>>>> 
>>>>>>>>> How do I change perl5 so as to use perl5.26 rather than perl5.24?
>>>>>>>>> 
>>>>>>>>> I find:
>>>>>>>>> 
>>>>>>>>> [me]$ sudo port installed |grep perl5
>>>>>>>>> ...
>>>>>>>>> perl5 @5.24.2_0+perl5_24 (active)
>>>>>>>>> perl5.24 @5.24.2_0 (active)
>>>>>>>>> perl5.26 @5.26.0_2 (active)
>>>>>>>>> 
>>>>>>>>> I tried:
>>>>>>>>> 
>>>>>>>>> [me]$ sudo port install perl5 -perl5.24 +perl5.26
>>>>>>>> 
>>>>>>>> Not possible because perl5 does not have a perl5.26 variant yet.
>>>>>>>> 
>>>>>>>> $ port variants perl5
>>>>>>>> perl5 has the variants:
>>>>>>>> [+]perl5_24: Use MacPorts perl5.24
>>>>>>>> 
>>>>>>>> I don't know if that's because nobody got around to it yet or if there's some problem with it.
>>>>>>>> 
>>>>>>> 
>>>>>>> But:
>>>>>>> 
>>>>>>> [me]$ sudo port info perl5
>>>>>>> 
>>>>>>> perl5 @5.24.2 (lang)
>>>>>>> Sub-ports:            perl5.16, perl5.18, perl5.20, perl5.22, perl5.24, perl5.26
>>>>>>> Variants:             [+]perl5_24
>>>>>>> 
>>>>>>> (And of course the perl5.26 port exists.)
>>>>>> 
>>>>>> Of course. The perl5.26 port exists. You can install and use it. But the perl5 port does not have a perl5_26 variant, which is what you asked about.
>>>>> 
>>>>> I guess I don’t understand what “info” is telling me: it says that per5 has a sub-port perl5.26. What does that mean?
>>>> 
>>>> It means that the perl5.26 port happens to be implemented as a subport of the perl5 port. Users don't really need to care whether a port is implemented as a subport or as a separate port. Subports are just a convenience for developers that lets multiple ports be defined within a single Portfile. It's a convenient way to reuse code for multiple similar ports, such as the multiple versions of perl that we offer.
>>>> 
>>>> Ports are different from variants. Each port can have variants. The perl5 port has a perl5_24 variant. It does not have a perl5_26 variant.
>>> 
>>> Then exactly what does it mean to say, as “info” claims, that perl5 has a perl5.26 sub-port? What is the relation of the perl5.26 sub-port to perl5?
>> 
>> The relationship is that both of them are defined in the same file -- this file:
>> 
>> https://github.com/macports/macports-ports/blob/master/lang/perl5/Portfile
>> 
>> Subports are shown in "port info" to help users discover related ports. For example if you want to install perl, and you run "port info perl5", you learn via the list of subports that you have a choice of which version(s) of perl5 you install.
>> 
> Sorry, still confused. “perl —version” reports “ perl 5, version 24.

Yes. "perl" is the symlink installed by the perl5 port. Because the +perl5_24 variant of the perl5 port is installed, that symlink points to the perl5.24 program.


$ ls -l $(port -q contents perl5)|grep 'bin/perl '
lrwxr-xr-x  1 root  wheel   8 Jul 24 22:30 /opt/local/bin/perl -> perl5.24


> Now that port perl5.26 is installed, how do I get to use perl 5.26?

You can run the "perl5.26" program directly:


$ perl5.26 -version | head -n 4

This is perl 5, version 26, subversion 0 (v5.26.0) built for darwin-thread-multi-2level

Copyright 1987-2017, Larry Wall


If you want to be able to run perl version 5.26 by just running "perl", file a ticket in the issue tracker and request the addition of a +perl5_26 variant to the perl5 port. As I said, I don't know why this has not already been done.


> (I know that for things like PHP, I can use “sudo port select …”.)

Yes. The saga of the perl ports and "sudo port select" is here:

https://trac.macports.org/ticket/29763






More information about the macports-users mailing list