perlbrew 0.29 contain improvements with some deprecations:
switch-off in addition to off
use and system
After alias command is introduced, it does not make good sense to keep those
special name with special purpose. perlbrew use system or perlbrew switch
system no longer mean to switch to system perl. The former is now simply perlbrew
off, and the later becames perlbrew switch-off.
The off command behaviour is changed to only affect current shell, while an
additional command switch-off is introduced to let user permananetly turn of
perlbrew.
The mechanism to make use, switch, off and switch-off command work needs
to change $PATH on-the-fly, therefore highly depends on shell integration.
For bash and zsh, there is a perlbrew shell function that does all the work.
User of csh / tcsh or other shells might find perlbrew use-less due to lack of
shell function, and therefore not possible to change $PATH in the invocation
of perlbrew commands.
To provide a work-around for non-(ba|z)sh users, a sub-shell is launched with
the tweaked $PATH inside that shell, which you have to exit explicitly
afterward.
% perlbrew use 5.12.3
A sub-shell is launched with perl-5.12.3 as the activated perl. Run 'exit' to finish it.
As a consequence, it is also possible for users who does not add
source $PERLBREW_ROOT/etc/bashrc in their shell to fallback to the sub-shell
mechanism. However, it is hightly recommend to add that source line if you
use bash or zsh.
If you intend to use perlbrew without its shell integration, there are caveats
on MacOS X that should be notified. A special /usr/libexec/path_helper command
has been used, since Snow Leopard. The shell initialziation processs, which you
cann find it in /etc/profile, /etc/zshenv or /etc/csh.login, set the
initial value of $PATH. As a result, changes to $PATH are lost in sub-shell.
You can confirm it by running these statements in an interactive shell:
## bash user % export PATH=/tmp/foobar:${PATH} % bash % echo $PATH # does not contain /tmp/foobar in the beginning
For this reason, it is impossible for perlbrew command to tweak $PATH value
without you to source its rc files. Also, for the same reason, if your or you
OS provides shell rc that resets $PATH regardless its current value, there is
not much perlbrew can do without the shell integration.
Again, it works much better if you simply use the perlbrew shell integration.