in reply to How do you export more than one path to PERL5LIB

You seem to want to update PERL5LIB with some paths if they are not there already. But your bash code is too far away from achieving this and it seems easier in Perl e.g.:
#/bin/sh # ... export PERL5LIB=`perl -e ' use strict; use warnings; my @addinc = ("/usr/local/lib/perl5/site_perl", "/Users/me/perl/perl_lib" ); my %inc = map { $_, 1 } split (/\:/, $ENV{PERL5LIB}); for (@addinc) { # this was just updated $inc{$_} or print "$_:"; } print "$ENV{PERL5LIB}\n"; '`

One world, one people

Replies are listed 'Best First'.
Re^2: How do you export more than one path to PERL5LIB
by Anonymous Monk on Aug 30, 2019 at 09:04 UTC
    With perlbrew, add to .bash_profile: export PERL5LIB=`perl -e '($p,$v)=split("-",$ENV{PERLBREW_PERL}); print "$ENV{HOME}/perl5/perlbrew/perls/perl-$v/lib/site_perl/$v/darwin-2level"' `