From 0da64a7f8a7ef155a211d923e67b54878855ee75 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 1 Oct 2003 14:42:52 +0000 Subject: warn: foreach (%xxx) { ... } --- perl_checker.src/parser_helper.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml index 29bb971..d12a43e 100644 --- a/perl_checker.src/parser_helper.ml +++ b/perl_checker.src/parser_helper.ml @@ -452,6 +452,8 @@ let check_for_foreach esp arg = if esp.any = "foreach" then warn esp.pos "you are using the special fpons trick to locally set $_ with a value, for this please use \"for\" instead of \"foreach\"" | List [ Deref_with(context, I_scalar, _, _) ] when context <> I_func -> if esp.any = "foreach" then warn esp.pos "you are using the special fpons trick to locally set $_ with a value, for this please use \"for\" instead of \"foreach\"" + | List [ Deref(I_hash, _) ] -> + warn esp.pos "foreach with a hash is usually an error" | _ -> if esp.any = "for" then warn esp.pos "write \"foreach\" instead of \"for\"" -- cgit v1.2.1