I'm seeing some odd behavior when I use the \rs hotkey combination to compile my perl script from within vim (non-gui) version. I have this simple code:

#!/usr/bin/perl use WWW::Mechanize; use Moose;

When I compile it within vim, I get void context errors:

1 /usr/share/perl5/WWW/Mechanize.pm|2545| Useless use of join or strin +g in void context 2 /usr/lib/x86_64-linux-gnu/perl5/5.20/Moose/Util/TypeConstraints.pm|6 +74| Useless use of private variable in void context 3 /usr/lib/x86_64-linux-gnu/perl5/5.20/Moose/Util/TypeConstraints.pm|6 +80| Useless use of private variable in void context 4 /usr/lib/x86_64-linux-gnu/perl5/5.20/Moose/Util/TypeConstraints.pm|6 +85| Useless use of private variable in void context 5 /usr/lib/x86_64-linux-gnu/perl5/5.20/Moose/Util/TypeConstraints.pm|6 +99| Useless use of private variable in void context

However, when I run perl -c <file> from the command line, I don't get any void context errors. What might explain this behavior and how to I fix it without resorting to throwing no warnings;...use warnings; around the use <package> statements?

Update: Actually, throwing no warnings;...use warnings; around the use <package> statements doesn't make the warnings go away. So I'm not even sure how to suppress them at all now. I'm using perl v 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


In reply to SOLVED: How to get rid of "void context" warnings when using vim's perl-support plugin by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.