App-perlbrew icon indicating copy to clipboard operation
App-perlbrew copied to clipboard

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

Open Grinnz opened this issue 10 years ago • 5 comments

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.

Grinnz avatar Jul 28 '15 20:07 Grinnz

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

gugod avatar Jul 28 '15 21:07 gugod

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

yanick avatar Jul 29 '15 13:07 yanick

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

KES777 avatar May 07 '22 19:05 KES777

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 avatar May 07 '22 20:05 yanick

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

yanick avatar May 19 '22 16:05 yanick