I tend to agree on the relatively low frequency that people might make this kind of mistake. But:
Also, "Probably" doesn't really belong in warnings :) it means this shouldn't be a warning
I beg to differ. Perl has quite a few warnings of this very nature, where a syntax is perfectly valid but probably not what the programmer meant. Some examples (see perldiag for more details and a more complete list):
Possible attempt to put comments in qw() list
Possible attempt to separate words with commas
Possible memory corruption: %s overflowed 3rd argument
Possible precedence issue with control flow operator
Possible precedence problem on bitwise %s operator
Possible unintended interpolation of $\ in regex
/%s/ should probably be written as "%s"
In reply to Re^2: "Useless use of a constant" in grep block?
by perlancar
in thread "Useless use of a constant" in grep block?
by perlancar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |