You have to dynamically change the Perl path in
based on the shebang line. For example:
:let perlExecutable = matchstr(getline(1), '^#!zsS+')
:let perlExecutable = (empty(perlExecutable) ?
'/home/utils/perl-5.14/5.14.1-nothreads-64/bin/perl' : perlExecutable) "
Default in case of no match
:let &makeprg = perlExecutable . ' -c % $*'
You can invoke that (maybe encapsulated in a function) on the
FileType event, but then it won't properly detect new files
that don't have the shebang yet. Or prepend the call to your
BufWritePost *.pl,*.pm,*.t :make; that will re-detect after each
PS: Instead of all those
:autocmd FileType in your
~/.vimrc, I would rather place those in
~/.vim/after/ftplugin/perl.vim (if you have
plugin on). Also, you should use
:setlocal instead of