I'm using perlbrew
to switch between perl versions. I also use Eclipse to write pe开发者_开发问答rl scripts.
It seems that Eclipse does not recognize the switches between perl versions, and keeps working with the base version installed out of perlbrew
. I tried restarting Eclipse but this doen't help.
So, How can I make Eclipse work with perlbrew
?
If you are using EPIC, this will work: Click through to Window->Preferences->Perl EPIC and set the Perl executable to perl5/perlbrew/bin/perl
. This always points to the current set version of perl. The path is relative to your $HOME on Linux.
I haven't tried this as I usually just use a text editor for Perl, but I have taken to using the shebang line #!/usr/bin/env perl
so that I get the perl
for the user that runs the script (ie. perlbrew if me, system perl if root). If Eclipse executes the script (./myscript.pl) this should work, if instead it calls
perl myscript.pl` then this will not help you.
精彩评论