简体   繁体   中英

How to make Eclipse/EPIC work with perlbrew

I'm using Eclipse/EPIC for programming/debugging and perlbrew to switch between perl versions. For any reason Eclipse/EPIC doesn't recognize switching the perl versions initiated by perlbrew. Switching the version is persistent but does only effect the terminal session. I tried already the method that was suggested in this forum...

Click through to Window->Preferences->Perl EPIC and set the Perl executable to

perl5/perlbrew/bin/perl

... but that didn't work. When entered, Eclipse/EPIC tries to run the perl -v command, which fails. I assume that is because there is no executable perl command accessible in this path. The path settings that actually should be changed by perlbrew apparently don't have any effect. When pointing instead onto the absolute path...

perl5/perlbrew/perls/<version>/bin/perl

...Eclipse/EPIC considers the requested version, but that's actually not what I want. Is there any other proper way to make Eclipse/EPIC work with perbrew? I'm running: MAC OS X -> Mountain Lion, Eclipse -> 4.2 JUNO, EPIC -> 0.5, perlbrew -> 0.58 .

Try using the full path:

/Users/<user>/perl5/perlbrew/perls/<version>/bin/perl

as suggested by a comment on your question.

The only workaround I have found is to use a wrapper for perl and set it as perl interpreter. If Your perlbrew init is in the default path, you can use the following bash wrapper:

#!/bin/bash
ACTIVE_PERL=`grep -o 'PERLBREW_PATH=.*' $HOME/.perlbrew/init | sed -e 's/"\|:/\n/g' | awk '/perls\/perl/ { print $0."/perl" }'`
$ACTIVE_PERL "$@"

place it somewhere, make it executable ( chmod 0755 ) and set it as the perl interpreter in EPIC. That will be executed each time EPIC turns to the perl interpreter, thus following if You switch with perlbrew. Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM