summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-08-25 11:22:06 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-08-25 11:22:06 +0000
commitfc6f2bfca5695bd36bedbb10d782fcb28a7492e6 (patch)
tree5433e9226c906a63215e05278d9cd30c99719d46
parent28bbbdc124ce453f983af075a18beb9d0c72018d (diff)
downloadperl_checker-fc6f2bfca5695bd36bedbb10d782fcb28a7492e6.tar
perl_checker-fc6f2bfca5695bd36bedbb10d782fcb28a7492e6.tar.gz
perl_checker-fc6f2bfca5695bd36bedbb10d782fcb28a7492e6.tar.bz2
perl_checker-fc6f2bfca5695bd36bedbb10d782fcb28a7492e6.tar.xz
perl_checker-fc6f2bfca5695bd36bedbb10d782fcb28a7492e6.zip
add checking for << and >> operators priority use
-rwxr-xr-xperl_checker4
1 files changed, 4 insertions, 0 deletions
diff --git a/perl_checker b/perl_checker
index fe94764..12cf3a2 100755
--- a/perl_checker
+++ b/perl_checker
@@ -67,6 +67,10 @@ if (/\bsub\b\s*\{[^{}]*\$_(?!\[)/) {
warn_(q(using $_ in a sub is generally bad news), info()) if !/local\s+\$_/;
}
+if ((my ($op) = /([<>]{2})/) && (/[+-]\s*[\w\$]+\s*[<>]{2}/ || /[<>]{2}\s*[\w\$]+\s*[+-]/) && !/\<\<[A-Z]/) { # don't warn for here-document alike
+ err(qq(parentheses needed around operator $op), info());
+}
+
if (/^\s*package ([\w:]+)/) {
$package = $1;
$path{$package} ||= ($ARGV =~ m|(.*/)|)[0];