This is one example of Perl's "helpful" warnings. Sometimes you wish it didn't do that, as in "yes I really ment to write that!".
Other examples include:
- tie my %REV, Interpolation => sub { reverse shift };
- Parentheses missing around "my" list
- @a = qw(foo, bar);
- Possible attempt to separate words with commas
Maybe what we need is a global way to suppress all these "coding tips"?
no warnings 'tips'; ? Or perhaps some way to set the minimum severity level of the warnings you want to see? These could be warnings of the lowest level, 1. Just a thought.
n.b. See perllexwarn for the existing hierarchy on warnings. I do see qw in that tree, but not print or my.
update: Apparently,
no warnings 'syntax';
suppresses all of these, so it could be a substitute. Unfortunalty, it also suppresses the "
Useless use of integer multiplication (*) in void context" warning (for example) which personally I do not consider fluff. Oh yes, that's a nice word.
no warnings 'fluff';
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.