From: Olivier Mengué Date: Thu, 14 Feb 2013 22:40:06 +0000 (+0100) Subject: Fix activate_paths when PERL_LOCAL_LIB_ROOT starts with ':' X-Git-Tag: 1.008008~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=64a79df2f57321d4f0db152032d466b5bea11c62;p=p5sagit%2Flocal-lib.git Fix activate_paths when PERL_LOCAL_LIB_ROOT starts with ':' As 'perl -Mlocal::lib' now generates "PERL_LOCAL_LIB_ROOT=$PERL_LOCAL_LIB_ROOT:~/perl5", the result of the expansion by the shell may be ":~/perl5", so the first element of the list created by splitting on ':' may be empty. So we have to ignore that empty element. --- diff --git a/lib/local/lib.pm b/lib/local/lib.pm index 387d111..5a6d9ab 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -433,7 +433,7 @@ sub active_paths { my ($class) = @_; return () unless defined $ENV{PERL_LOCAL_LIB_ROOT}; - return split /\Q$Config{path_sep}/, $ENV{PERL_LOCAL_LIB_ROOT}; + return grep { $_ ne '' } split /\Q$Config{path_sep}/, $ENV{PERL_LOCAL_LIB_ROOT}; } sub build_deactivate_environment_vars_for {