nysus has asked for the wisdom of the Perl Monks concerning the following question:

A Monk just turned me on to the perlsupport plugin in VIM. I'm trying to make use of the syntax checking feature invoked with \rs. It's very cool but I have a couple of questions about it.

First, it is giving me the following output:

/usr/share/perl5/WWW/Mechanize.pm|2545| Useless use of join or string +in void context /usr/share/perl/5.20/constant.pm|156| Constant subroutine StevesPerlTo +ols::DATA_DIR redefined /usr/lib/x86_64-linux-gnu/perl5/5.20/Moose/Util/TypeConstraints.pm|674 +| Useless use of private variable in void context /usr/lib/x86_64-linux-gnu/perl5/5.20/Moose/Util/TypeConstraints.pm|680 +| Useless use of private variable in void context /usr/lib/x86_64-linux-gnu/perl5/5.20/Moose/Util/TypeConstraints.pm|685 +| Useless use of private variable in void context /usr/lib/x86_64-linux-gnu/perl5/5.20/Moose/Util/TypeConstraints.pm|699 +| Useless use of private variable in void context /usr/lib/x86_64-linux-gnu/perl/5.20/DynaLoader.pm|210| Subroutine HTML +::Strip::DESTROY redefined

These are not my modules and are modules that I am useing. I would like to have vimsupport just ignore these other modules. Is there a way to do that? Or maybe there is a way to tell vimsupport to ignore these particular warnings?

Second, how do I easily jump back to the original file I invoked the syntax checker from? AFAICT, I have to :q out of syntax checking mode and then reopen my original file. Is there a better way to get back to it?

I could not find anything in the documentation that addressed these questions. I am using the nongui version. Thanks.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re: Using the syntax checking feature in vim perlsupport plugin
by hippo (Archbishop) on Apr 15, 2016 at 08:21 UTC

    Those messages are warnings, so if you really don't want to see them you can bracket your use statements like this:

    no warnings; use WWW::Mechanize; # ... other use statements here use warnings;

    But I don't advise that because you'll miss out on messages like "Constant subroutine StevesPerlTools::DATA_DIR redefined" which sounds to me like something requiring fixing. If the third-party modules on their own compile without warnings then again these likely indicate some problem with the way you are using them. OTOH, if the warnings persist when the modules are compiled stand-alone that's probably worth bringing to the attention of the module author.

    If there are warnings or errors reported from the syntax check just hit return and it will take you to where the error occurred in your code. Fix that, re-run the syntax check and the other window will refresh with the new report. Keep doing that until they're all gone and you'll simply have the line "file.pl : Syntax is OK" in your status line.

      So the warning that WWW::Mechanize is giving is from this subroutine here:

      sub _is_tainted { no warnings qw(void uninitialized); return !eval { join('', shift), kill 0; 1 }; } # _is_tainted

      The code says to ignore the void warnings so I'm not sure why perlsupport is complaining about it. Any fix?

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks

        My version of WWW::Mechanize gives no such warning:

        $ cat wwwm.pl use strict; use warnings; use WWW::Mechanize; $ perl -cw wwwm.pl wwwm.pl syntax OK

        Either you are loading it differently or you are on a different version of WWW::Mechanize - mine is 1.74

Re: Using the syntax checking feature in vim perlsupport plugin
by nysus (Parson) on Apr 15, 2016 at 20:09 UTC

    I've discovered that you can close out a buffer in vim with the :bdelete aka :bd command.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks