Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Using the syntax checking feature in vim perlsupport plugin

by hippo (Bishop)
on Apr 15, 2016 at 08:21 UTC ( [id://1160497]=note: print w/replies, xml ) Need Help??


in reply to Using the syntax checking feature in vim perlsupport plugin

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.

Replies are listed 'Best First'.
Re^2: Using the syntax checking feature in vim perlsupport plugin
by nysus (Parson) on Apr 15, 2016 at 14:44 UTC

    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

        Yeah, I'm on 1.73 but when I looked at the source for 1.75 it had the same exact lines so I didn't bother to install it. I'm invoking it the same way you are.

        I guess I'll try upgrading. I installed the module using Debian package manager. What's the best practice for overriding the stock Perl module in Debian? This is another area I'm weak on.

        Update: This thread looks like a pretty thorough discussion of the options: http://www.perlmonks.org/?node_id=753416

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

        OK, managed to create a backport and confirmed that my script is now using version 1.75 of WWW::Mechanize. I'm still getting that damn warning, though. Do you think it might be my version of Perl? Update: I'm using perl 5.20.2.

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

Re^2: Using the syntax checking feature in vim perlsupport plugin
by nysus (Parson) on Apr 16, 2016 at 11:14 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1160497]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-19 02:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found