gugod/App-perlbrew — pull request #290 by djerius (2013-03-04 06:33:13+00:00)
Title: add semi-colon to end of each shell commands so that shell interprets th...

Shell commands output by perlbrew need to have semi-colons after them or the
shell will not evaluate them as independent commands. When switching from a lib
to a non-lib setup, perlbrew emits code which looks like this:

```
export PATH=...
unset PERL5LIB
unset PERLBREW_LIB
```
which after the `code="$(command perlbrew env $2)"` command the shell sees as

```
export PATH=... unset PERL5LIB unset PERLBREW_LIB
```

and the `unset` commands never get run. For example:

```
% cat > try
export FOO=1
unset FOO
% echo $FOO

% code=$(cat try)
% eval $code
% echo $FOO
1
%
```
Appending a semi-colon to the end of each line fixes the problem. This problem causes remnants of the old environment to remain after the switch (in particular PERL5LIB) which means that you could be unknowingly running against dev libraries (which is how I found this bug).

Thanks,
Diab