diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-10-01 14:42:52 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-10-01 14:42:52 +0000 |
commit | 10921a1e8b0655e388d9129c73534d2f16807c75 (patch) | |
tree | 2461490c1fc1dc54de995f858215b00f799030f5 /perl_checker.src | |
parent | dcc614c6e1d8dbc834d861eacf04ef96542f287f (diff) | |
download | perl-MDK-Common-10921a1e8b0655e388d9129c73534d2f16807c75.tar perl-MDK-Common-10921a1e8b0655e388d9129c73534d2f16807c75.tar.gz perl-MDK-Common-10921a1e8b0655e388d9129c73534d2f16807c75.tar.bz2 perl-MDK-Common-10921a1e8b0655e388d9129c73534d2f16807c75.tar.xz perl-MDK-Common-10921a1e8b0655e388d9129c73534d2f16807c75.zip |
warn: foreach (%xxx) { ... }
Diffstat (limited to 'perl_checker.src')
-rw-r--r-- | perl_checker.src/parser_helper.ml | 2 |
1 files changed, 2 insertions, 0 deletions
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\"" |