Subject: | patch to enable same set-up in cshrc as in bashrc |
Date: | Wed, 04 Aug 2010 16:12:24 +0100 |
To: | bug-local-lib [...] rt.cpan.org |
From: | Frank Schwach <fs5 [...] sanger.ac.uk> |
For csh, the documentation currently suggests to hardcode the 'setenv'
statements, generated by local::lib into .cshrc, whereas the bashrc
set-up makes use of dynamic command substitution, i.e.
bash:
echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >>~/.bashrc
csh:
/bin/csh
perl -I$HOME/perl5/lib/perl5 -Mlocal::lib >> ~/.cshrc
As far as I can see, the only reason why the dynamic command
substitution approach doesn't work in csh is that csh removes the
newlines between the 'setenv' commands. All that is needed to circumvent
the problem is to seperate the 'setenv' commands with semicolons.
In
sub build_bourne_env_declaration {
my $class = shift;
my($name, $value) = @_;
return qq{export ${name}="${value}"\n};
}
changing the last line to:
to
return qq{export ${name}="${value}";\n};
works fine for me and now I can use
eval `perl -I$HOME/perl5/lib/perl5 -Mlocal::lib`
in my .cshrc to get the same behaviour as under bash.
Hope this can be useful.
Cheers,
Frank
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.