note
markjugg
It looks like you are trying to re-invent the nice quickfix mode integration for Perl that's built into VIM 6.0. Here's how to get started with it. It's super handy.
<UL>
<LI><B>Quickfix Mode Integration</B> Like other great editors, vim
has a built in mechanism to speed up the compile-debug-edit cycle.
Here's the least you need to know to get running with this.
<OL>
<LI><B>Tweak your .vimrc file</B> Add these lines to your .vimrc
to get started. The first command tells vim to compile the
current buffer when you type ":make", the second command tells
vim to recognize the error format that Perl returns. <p>
<pre>
set makeprg=$VIMRUNTIME/tools/efm_perl.pl\ -c\ %\ $*
set errorformat=%f:%l:%m
</pre>
<P>
To make this cycle even faster, also add this line:<P>
<pre>
set autowrite
</pre>
<P>
That will cause the file to automatically be saved in some
cases, such as when you type ":make".
<LI><B>Set your Perl Path</b> If you are using some of your own
modules, you need to give vim a hint about where to find them.
There are two straightforward ways to handle this. One is to
set the path in one of the environment variables that Perl will
look in, such as PERL5LIB. The other method is to simply use vim
command ":lcd" to set the Local Current Directory for the perl
file you want to compile to be relevant libary path.</LI>
<LI><B>Compile your Perl from within vim</b> You are now ready
to compile a script from within vim. Simply use ":make" for
this. Vim will run "perl -c yourscript.cgi" and process the
results. It will show you a list of the resulting errors, if
any, and jump to the first error.
<LI><B>Navigate your errors</B>
You are now in quickfix mode
and have some commands available to quickly address the
remaining errors. Here are the essential commands for this:
":cl" lists all the errors for you again, ":ccN" jumps to
error number 'N', ":cn" jumps to the next error. You can read
the details with ":help quickfix"
</OL>
</LI>
</UL>
<P>
-<A HREF="http://mark.stosberg.com/">mark</A>
143348
143348