Subject: | Emitted sh/bash code fails under "set -u" |
perl -I$HOME/perl5/lib/perl5 -Mlocal::lib
generates shell commands like this:
PERL5LIB=".../perl5/lib/perl5${PERL5LIB+:}${PERL5LIB}"; export PERL5LIB;
but it would more correctly be
PERL5LIB=".../perl5/lib/perl5${PERL5LIB+:$PERL5LIB}"; export PERL5LIB;
so that it won't cause an error if executed when "set -u" is in effect
(set -u tells the shell to object if an undefined variable is interpolated).
The difference is that the possibly-pre-existing-or-not $PERL5LIB is interpolated inside the ${PERL5LIB+ ... } so that it is not interpolated if it was not previously set.