Code Monkey home page Code Monkey logo

Comments (9)

glasswalk3r avatar glasswalk3r commented on June 20, 2024

Although this configuration solves the issue regarding the Perl interpreter and @INC configuration, when I used the \rs (check syntax) command I always got something that is missing in the current @INC, for example:

ListEvtLogLvl.pm|3| Can't locate Moose.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .)
ListEvtLogLvl.pm|3| BEGIN failed--compilation aborted

Since I'm using Perl 5.16, this configuration is wrong. I doubled checked the @INC configuration with this in the .vimrc:

if has("gui_running") && filereadable($HOME . "/perl5/perlbrew/etc/bashrc")
    let $PATH=system("source " . $HOME . "/perl5/perlbrew/etc/bashrc; echo -n $PATH")
    let $test=system("perl -E 'foreach(@INC) { say $_ }'")
    echo $test
endif

And the dialog box showed the correct configuration.

Reviewing the perl-support.vim plugin, I found that the Perl interpreter path being used in hard coded to "/usr/bin/perl" but that does not help with Perlbrew. I added the following (line number included):

 162   let s:Perl_Perl                 = system("/usr/bin/which perl")
 163   let s:Perl_Perl                 = substitute(s:Perl_Perl, '\n$', '', '')

And it seems to be working correctly now when checking syntax,

from vim-plugins.

WolfgangMehner avatar WolfgangMehner commented on June 20, 2024

You can actually set the Perl executable in your .vimrc using "g:Perl_Perl", see:

:help perlsupport-perl6

from vim-plugins.

glasswalk3r avatar glasswalk3r commented on June 20, 2024

For some reason that help is not available:

E149: Sorry, no help for perlsupport-perl6

I tried on a CentOS 7, with Vim 7.4.160.

from vim-plugins.

WolfgangMehner avatar WolfgangMehner commented on June 20, 2024

The help topic should still be there. But I renamed the setting to g:Perl_Executable.

Try using the map \hp or the menu entry Perl -> Help -> help (Perl-Support), it will generate the helptags for Perl-Support if they are not available.

from vim-plugins.

g-i-o-r-g-i-o avatar g-i-o-r-g-i-o commented on June 20, 2024

This still works:
let g:Perl_Executable = 'perl'

ubuntu 17.10
vim 8
perlbrew
perl 5.26

from vim-plugins.

WolfgangMehner avatar WolfgangMehner commented on June 20, 2024

This is the default as of version 5.4.1, 132828c : let g:Perl_Executable = 'perl'

Hopefully this will resolve the perlbrew problems and always use the version you use in the shell, by actually choosing the correct executable from $PATH.

from vim-plugins.

glasswalk3r avatar glasswalk3r commented on June 20, 2024

Tried that on Ubuntu 18.04, latest release of perl-support.
Setting let g:Perl_Executable = 'perl' on ~/.vimrc works as expected, including for properly locating modules on custom @INC, but not for Gvim: even after repeating the configuration on ~/.gvimrc, the "selected" perl with Perlbrew doesn't work.
Double checked by running !perl -v on [G]Vim command mode, and on Gvim the standard perl that comes with Ubuntu is used.

from vim-plugins.

WolfgangMehner avatar WolfgangMehner commented on June 20, 2024

OK, good debugging there. Unfortunatly it seems like the problem is not with Perl-Support itself, so it's harder for me to help you. Perl-Support depends on being able to run !perl -v correctly.

Could you compare the output of Vim vs. gVim when you run this on the Vim command line: :echo $PATH

Does it make a difference if you start gVim from a terminal or the desktop (using the Unity-App-Search-And-Starter-Thingy, whatever that's called)?

from vim-plugins.

glasswalk3r avatar glasswalk3r commented on June 20, 2024

Sorry for taking so long to answer.
Yes, it does make a difference. I tested calling from the Desktop, it doesn't work but if I open gVim from the terminal, it does work as expected.
Tested on CentOS 7.

from vim-plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.