Vim Scripting - passing parameters to/from Perl code using Perl interface

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Vim Scripting - passing parameters to/from Perl code using Perl interface

Marcin Komorowski
Vim provides a very nice way of executing Perl code right within Vim
scripts, but I have been trying to find a way to pass parameters to this
code, and return parameters from it.  I have been unable to find a way so
far.  Does anyone know a solution?

Thanks,
Marcin


Reply | Threaded
Open this post in threaded view
|

Re: Vim Scripting - passing parameters to/from Perl code using Perl interface

Suresh Govindachar`


   Marcin Komorowski sent on 22 Sep 2005 12:24:41 -0400:

  > Vim provides a very nice way of executing Perl code right within
  > Vim scripts, but I have been trying to find a way to pass
  > parameters to this code, and return parameters from it.  I have
  > been unable to find a way so far.  Does anyone know a solution?

  It is possible to call perl functions from vim scripts and
  vim functions from perl and to get return values in both
  cases.  For a complex example, see
  http://www.vim.org/scripts/script.php?script_id=1052
  There is also a vim-tip about this -- but the tip is
  confusing and requires very careful re-reading to figure
  out all the techniques:
  http://www.vim.org/tips/tip.php?tip_id=140

  --Suresh

Reply | Threaded
Open this post in threaded view
|

Re: Vim Scripting - passing parameters to/from Perl code using Perl interface

A.J.Mechelynck
In reply to this post by Marcin Komorowski
----- Original Message -----
From: "Marcin Komorowski" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, September 22, 2005 6:24 PM
Subject: Vim Scripting - passing parameters to/from Perl code using Perl
interface


> Vim provides a very nice way of executing Perl code right within Vim
> scripts, but I have been trying to find a way to pass parameters to this
> code, and return parameters from it.  I have been unable to find a way so
> far.  Does anyone know a solution?
>
> Thanks,
> Marcin

It is possible to pass parameters both ways; how to do it is described under
":help if_perl.txt". However, since the Perl interface is usually
"dynamically" included, you need to have access to the library for the same
version of Perl for which your version of Vim was compiled. The name of the
shared library can usually be found under "Compilation:" near the bottom of
the ":version" listing. For instance, if you use a Vim version compiled by
me for W32, you must have the file perl58.dll in your PATH to use the Perl
interface.


Best regards,
Tony.