How can I make eclipse perl project use a specific perl version?

血红的双手。 提交于 2019-12-13 00:56:04

问题


I have mounts of a remote source code repos in Linux servers.
I use Eclipse Epic and I have made links to the scripts there with the help of the answer of this post.
My problem is the following:
The project in the remote repository uses a specific version of Perl which is under a specific directory.
How would I configure my project in Eclipse to have/use exactly the same Perl?


回答1:


I haven't tested this with an interpreter on a remote machine and I'm on Windows but I think this would work.

  1. Go to Window -> Preferences -> Perl EPIC

  2. Click ... next to Perl executable and choose the location you want (this would be under your remote repository)

  3. Click Apply / OK

To check if it works, just do this:

use strict;
use warnings;

print "Version: $]\n";
print "Interpreter: $^X\n";



回答2:


I had the same question, because I have some Perl32 and Perl64 programs which I have to compile with different interpreters. And think, the main question was: "How can I use a particular perl interpreter for each project?"

EPICs preferences will change the interpreter for all projects, but not for a single one.

My solution was to create a small script as a wrapper for the perl interpreter. Then, in the properties of each project, I added a meaningless Perl Include Path, which serves only as a hint on the interpreter, because EPIC passes this Include Path as a parameter to perl. The wrapper script then looks for this hint and fires the right perl version.



来源:https://stackoverflow.com/questions/17760498/how-can-i-make-eclipse-perl-project-use-a-specific-perl-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!