http://qs321.pair.com?node_id=257797


in reply to Vim for Perl developers

That's great work. But I am wondering if you could help answer a vim question I have. How would I specify a Perl script to execute with the interpreter? I am not talking about doing:   <ESC>:! perl script.pl

What I would like to do is access the Perl interpreter from within vim. With ruby, one can use the rubyfile command. From vim's command mode, you could type  :rubyfile example.rb to execute a ruby script. But how would you do this with Perl?

Replies are listed 'Best First'.
Re: Re: Vim for Perl developers
by TVSET (Chaplain) on May 13, 2003 at 17:37 UTC
    That's great work.

    Thanks :)

    What I would like to do is access the Perl interpreter from within vim. With ruby, one can use the rubyfile command. From vim's command mode, you could type :rubyfile example.rb to execute a ruby script. But how would you do this with Perl?

    I've got rather limited experience in this area, but maybe :help perldo will help you. I guess you'll need to have Vim compiled with perl support.

    Leonid Mamtchenkov aka TVSET

      Thanks, but perldo is a range command, so that won't work.
        :perl do "filename.pl"

        :perl lets you do arbitrary expressions.
        ---Iain.
Re: Re: Vim for Perl developers
by naChoZ (Curate) on Jun 06, 2003 at 18:47 UTC
    I wonder if you would find this useful. In .vimrc put:

    au BufWritePost *.pl,*.pm !perl -c %

    Every time you save a .pl or .pm file, it executes perl -c and shows you the output.

    ~~
    naChoZ

      Better would probably be something like:
      au BufWritePost *.pl,*.pm !perl -wcIlib %
      Warnings are important. -Ilib is probably also important, but maybe only I do editing in the root directory of my projects.

      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?