Subject: | noclobber shell option prevents switch |
The bash shell option 'noclobber' (which prevents accidental overwriting
of existing files when using shell redirection) prevents Perlbrew from
being able to switch perls.
This seems to be due to __perlbrew_reinit() which creates
$HOME/.perlbrew/init anew using shell redirection.
This can be fixed by writing the redirection as (patch attached):
echo '# DO NOT EDIT THIS FILE' >| $HOME/.perlbrew/init
When the noclobber shell option is not set, the semantics will be the
same.
Subject: | noclobber.patch |
--- perl5/perlbrew/etc/bashrc.bak 2011-03-10 11:47:26.627288000 +0100
+++ perl5/perlbrew/etc/bashrc 2011-03-10 11:47:42.155910000 +0100
@@ -9,7 +9,7 @@
mkdir -p $HOME/.perlbrew
fi
- echo '# DO NOT EDIT THIS FILE' > $HOME/.perlbrew/init
+ echo '# DO NOT EDIT THIS FILE' >| $HOME/.perlbrew/init
command perlbrew $short_option env $1 >> $HOME/.perlbrew/init
source $HOME/.perlbrew/init
__perlbrew_set_path