summaryrefslogtreecommitdiffstats
path: root/perl_checker.src
diff options
context:
space:
mode:
Diffstat (limited to 'perl_checker.src')
-rw-r--r--perl_checker.src/parser_helper.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml
index 1ddeebc..696a36e 100644
--- a/perl_checker.src/parser_helper.ml
+++ b/perl_checker.src/parser_helper.ml
@@ -588,6 +588,10 @@ let call_op_((prio, (prev_ter, op)), ter, para) (sp, pos) =
warn_rule "don't do this"
else if List.exists (function Num _ -> true | _ -> false) para then
warn_rule (sprintf "you should use a number operator, not the string operator \"%s\" (or replace the number with a string)" op)
+ | "||=" | "&&=" ->
+ (match List.hd para with
+ | List [ List _ ] -> warn_rule "remove the parentheses"
+ | e -> if is_not_a_scalar e then warn_rule (sprintf "\"%s\" is only useful with a scalar" op))
| _ -> ());
sp_same prev_ter ter ;
(prio, cook_call_op(op, para, pos)), (sp, pos)