in reply to ERROR: The installation "perl-5.20.1" is unknown.

G'day thanos1983,

I do not know if this is also relevant:

$ which perl /usr/local/bin/perl

That's probably very relevant. It looks like the system Perl. Here's what I get:

$ perlbrew switch perl-5.24.0t $ which perl /Users/ken/perl5/perlbrew/perls/perl-5.24.0t/bin/perl

In "Re^2: ERROR: The installation "perl-5.20.1" is unknown.", you posted:

My list is:

$ perlbrew list perl-5.20.3 current (5.24.1)

Note that none of the versions listed are preceded by an asterisk. This means that perlbrew is disabled and the system Perl has been enabled. You potentially used either the off or switch-off commands, see perlbrew for full details.

I can reproduce this:

$ which perl /Users/ken/perl5/perlbrew/perls/perl-5.24.0t/bin/perl $ perlbrew off perlbrew is turned off. $ perlbrew list perl-5.14.0t perl-5.14.2 perl-5.14.2t perl-5.18.0t perl-5.18.1t perl-5.20.0t perl-5.20.2t perl-5.22.0t perl-5.24.0t perl-5.25.9t $ which perl /usr/local/bin/perl

Then, in "Re^2: ERROR: The installation "perl-5.20.1" is unknown.", you posted:

perlbrew switch 5.20.3 ... $ perlbrew list * perl-5.20.3 current (5.24.1)

Now you'll see that the selected Perl has an asterisk.

Again, I can reproduce this:

$ perlbrew switch perl-5.20.2t $ perlbrew list ... perl-5.20.0t * perl-5.20.2t perl-5.22.0t ... $ which perl /Users/ken/perl5/perlbrew/perls/perl-5.20.2t/bin/perl $ perl -v | head -2 | tail -1 This is perl 5, version 20, subversion 2 (v5.20.2) built for darwin-th +read-multi-2level

The name perl-5.20.3 has no direct bearing on the actual Perl version! While it intuitively makes sense to associate that name with Perl version 5.20.3, you don't have to. You could've called it fred or perl-99.99.99. When I install a new version, I use the '--as' switch to set the name. Once installed, you can use the alias command to create a new name. The perlbrew doco has details of these. To be absolutely certain which Perl version you're using, I suggest using an absolute path, something like this:

$ perlbrew switch Currently switched to perl-5.20.2t $ which perl /Users/ken/perl5/perlbrew/perls/perl-5.20.2t/bin/perl $ /Users/ken/perl5/perlbrew/perls/perl-5.20.2t/bin/perl -v | head -2 | + tail -1 This is perl 5, version 20, subversion 2 (v5.20.2) built for darwin-th +read-multi-2level

As for "current (5.24.1)" in your list, I probably can't help much. With an older version of App::perlbrew, "perlbrew list" used to give me every Perl on my system; I think there were an additional three, and each maybe had a format similar to "current (5.24.1)". This was all some time ago: I wouldn't put money on me recalling this accurately. Now I only get the Perls installed by perlbrew. I'm currently using "App::perlbrew 0.73"; perhaps consider upgrading if you're using an earlier version.

— Ken

Replies are listed 'Best First'.
Re^2: ERROR: The installation "perl-5.20.1" is unknown.
by afoken (Chancellor) on Apr 13, 2017 at 10:57 UTC
    $ which perl /usr/local/bin/perl
    That's probably very relevant. It looks like the system Perl.

    No, it doesn't. System perl is usually in /usr/bin, /usr/local/bin is reserved for locally administrated stuff outside the distribution. See also https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard.

    But then again, as several scripts start with #!/usr/local/bin/perl, it is quite common to have a symlink /usr/local/bin/perl pointing to some perl, e.g. /usr/bin/perl.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)