gugod / App-perlbrew

Manage perl installations in your $HOME
https://perlbrew.pl
Other
720 stars 216 forks source link

Prior PERL5LIB is not correctly updated in fish shell for local::libs #479

Open Grinnz opened 9 years ago

Grinnz commented 9 years ago

In fish shell, when PERL5LIB is already set to something and one switches to a local::lib such as perlbrew use 5.22.0@testlib, PERL5LIB is updated to be something like:

PERL5LIB="/home/user/.perlbrew/libs/perl-5.22.0@testlib/lib/perl5 /some/other/perl/lib"

This is incorrect, and results in the following @INC (the first entry does not represent an existing directory, so modules installed there are not found):

  @INC:
    /home/user/.perlbrew/libs/perl-5.22.0@testlib/lib/perl5 /some/other/perl/lib
    /home/user/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux
    /home/user/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0
    ...

If PERL5LIB is updated to use : then @INC shows up correctly:

set -x PERL5LIB "/home/user/.perlbrew/libs/perl-5.22.0@testlib/lib/perl5:/some/other/perl/lib"
  @INC:
    /home/user/.perlbrew/libs/perl-5.22.0@testlib/lib/perl5/x86_64-linux
    /home/user/.perlbrew/libs/perl-5.22.0@testlib/lib/perl5
    /some/other/perl/lib
    /home/user/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux
    /home/user/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0
    ...

I believe this is because PERL5LIB is being set as if it was PATH, but it does not follow the rules of PATH, it is parsed by perl directly. Entries should be separated by : and not spaces, unlike with PATH, where spaces are used for fish shell. This also applies for any other environment vars used by perl directly, and not the shell.

gugod commented 9 years ago

You are absolutely correct. entries in PERL5LIB are seperated with ":" instead of blank. cc our fish master @yanick here :)

yanick commented 9 years ago

Heh. Will be back from vacation tomorrow and will have a look at it then. :-)

KES777 commented 2 years ago

@yanick ping ping =) Are you still on vacation?? O:-)

yanick commented 2 years ago

Oh god. I totally forgot about that. I'll check it out tomorrow. Pwomise.

On Sat, 7 May 2022, at 3:26 PM, Eugen Konkov wrote:

@yanick https://github.com/yanick ping ping =) Are you still on vacation?? O:-)

— Reply to this email directly, view it on GitHub https://github.com/gugod/App-perlbrew/issues/479#issuecomment-1120271153, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAE34XDYJ5FFFVAWZ527YTVI27XTANCNFSM4BMGCWPA. You are receiving this because you were mentioned.Message ID: @.***>

yanick commented 2 years ago

Installing back perlbrew as we speak to check things out. Oooh the memories. :smiling_face_with_tear: