[Chicago-talk] Use vi in perl
Robert Blackwell
robert at robertblackwell.com
Tue May 24 17:18:05 PDT 2011
http://search.cpan.org/~rokr/Term-EditorEdit-0.0015/lib/Term/EditorEdit.pm has proved useful to me.
Used with
http://search.cpan.org/~rjbs/Test-Deep-0.108/lib/Test/Deep/NoTest.pm
and
http://search.cpan.org/~shlomif/Config-IniFiles-2.66/lib/Config/IniFiles.pm
On May 24, 2011, at 4:49 PM, tiger peng <tigerpeng2001 at yahoo.com> wrote:
> Hello all,
>
> I am trying to use vi as a UI to edit/check dynamic created perl code segment. When user save and quite the vi, the script will check its syntax and force to open the file again if there are any compiling error. I'd like to have the error message show in the new opened vi interface but don't know how to do it. Is here any suggestion?
>
> Thanks,
>
> Below is the segment invoke vi and do the check?
>
> my $msg;
> do {
> if (defined $msg) {
> warn "$msg";
> my $dummy = <STDIN>;
> }
> system("/bin/vi", $tmpfile) == 0 or die $!;
> $msg = `/usr/bin/perl -c $tmpfile`;
> } while ($? != 0);
>
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/chicago-talk/attachments/20110524/e65bb4a9/attachment.html>
More information about the Chicago-talk
mailing list