Subject: | Switching perls doesn't take effect until shell restart |
Date: | Sat, 24 Apr 2010 11:43:08 -0700 |
To: | bug-App-perlbrew [...] rt.cpan.org |
From: | Brad Bollenbach <bradb [...] 30sleeps.com> |
Hi,
perlbrew isn't switching perls properly. This appears to be due to the
way bash caches command path names, e.g.:
[bradb@greenhouse ~]$ perl -v
This is perl, v5.10.1 (*) built for darwin-2level
...
[bradb@greenhouse ~]$ perlbrew switch perl-5.12.0
[bradb@greenhouse ~]$ perl -v
This is perl, v5.10.1 (*) built for darwin-2level
...
After opening a new shell:
[bradb@greenhouse ~]$ perl -v
This is perl 5, version 12, subversion 0 (v5.12.0) built for
darwin-2level
Or, in the same shell prior to opening the new shell:
[bradb@greenhouse ~]$ hash -d perl
[bradb@greenhouse ~]$ perl -v
This is perl 5, version 12, subversion 0 (v5.12.0) built for
darwin-2level
The behaviour that I expect instead is that:
$ perlbrew switch perl-5.12.0
$ perl -v
Immediately return the version of the perl just switched to, without
the need to open a new shell or run 'hash -d perl'.
Shell version:
[bradb@greenhouse ~]$ bash --version
GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0)
Running on OS X Leopard.
Cheers,
Brad