On Jan 20, 2022, at 22:12, Gabriel Rosenkoetter wrote:

> I didn't have the perl5 port installed on this system at all, just the 
> several perl5.xx ports. So I did `sudo port install perl5`.
> 
> And that's neat, but:
> 
> [58] (gr@wedge:~)% which perl
> /opt/local/bin/perl
> [59] (gr@wedge:~)% ls -l `!!`
> ls -l `which perl`
> lrwxr-xr-x  1 root  admin  8 Dec  6  2020 /opt/local/bin/perl -> perl5.28
> [60] (gr@wedge:~)%
> 
> And `port select --summary` is still just Python stuff:
> 
> [60] (gr@wedge:~)% port select --summary
> Name     Selected  Options
> ====     ========  =======
> pip      pip37     pip3-apple none
> pip2     none      none
> pip3     none      pip3-apple none
> python   none      python27 python27-apple python37 python38-apple python39 
> none
> python2  none      python27 python27-apple none
> python3  python37  python37 python38-apple python39 none
> [61] (gr@wedge:~)% sudo port select --list perl
> Warning: Unable to get active selected version: The specified group 'perl' 
> does not exist.
> Error: The 'list' command failed: The specified group 'perl' does not exist.
> [62] (gr@wedge:~)% sudo port select --list perl5
> Warning: Unable to get active selected version: The specified group 'perl5' 
> does not exist.
> Error: The 'list' command failed: The specified group 'perl5' does not exist.
> [63] (gr@wedge:~)% sudo port select --set perl perl5.34
> Selecting 'perl5.34' for 'perl' failed: The specified group 'perl' does not 
> exist.
> [64] (gr@wedge:~)% sudo port select --set perl5 perl5.34
> Selecting 'perl5.34' for 'perl5' failed: The specified group 'perl5' does not 
> exist.
> [65] (gr@wedge:~)%
> 
> Does the Perl port not support version selection this way, or am I still not 
> remembering the right way to do this?
> 
> For example, is the user expected to create their own perl (or perl5) group?
> 
> Shouldn't installing the port at least plug some defaults in for those 
> entries?
> 
> I'm eminently aware that Perl and Python behave differently wrt module 
> support, but shouldn't MacPorts at least try to provide a consistent 
> interface across them?

As was already mentioned, the /opt/local/bin/perl symlink is controlled by the 
perl5 port, so install it with whatever variant you wish.

Unlike most of the other ports like python, php, ruby, and others where you 
have a choice of version, the perl ports do not use the select mechanism. 
Modifying them to use the select mechanism (and more specifically modifying 
every port that currently depends on port:perl5 or path:bin/perl:perl5 to use a 
specific version of perl) would be a large undertaking, and I'm not sure the 
benefit would outweigh the drawbacks and the effort involved.

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


Reply via email to