pretzlstyle
pretzlstyle

Reputation: 2962

Why is this perl command giving unexpected results?

In my .bashrc, I have

eval "$(perl -I$HOME/util/perl5/lib/perl5 -Mlocal::lib)"; export PERL5LIB=$HOME/util/perl5:$PERL5LIB

if afterward I do

env | grep PERL5LIB

I see

PERL5LIB=/home/myUser/util/perl5:/home/myUser/perl5/lib/perl5:

Why is the second path not correct? I would expect

/home/myUser/util/perl5/lib/perl5

to be added to PERL5LIB, rather than

/home/myUser/perl5/lib/perl5

am I misunderstanding something about the perl command passed to eval? Th output of that command, run in the command line (rather than from .bashrc) is

$ perl -I$HOME/util/perl5/lib/perl5 -Mlocal::lib
Attempting to create directory /home/myUser/perl5
$

Upvotes: 0

Views: 91

Answers (1)

ikegami
ikegami

Reputation: 386351

Unless you tell it otherwise, local::lib uses ~/perl5.

Change

perl -I$HOME/util/perl5/lib/perl5 -Mlocal::lib

to

perl -I$HOME/util/perl5/lib/perl5 -Mlocal::lib=$HOME/util/perl5

Upvotes: 4

Related Questions