diff options
Diffstat (limited to 'perl_checker.src/test/context.t')
-rw-r--r-- | perl_checker.src/test/context.t | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/perl_checker.src/test/context.t b/perl_checker.src/test/context.t new file mode 100644 index 0000000..5fd7809 --- /dev/null +++ b/perl_checker.src/test/context.t @@ -0,0 +1,15 @@ +foreach (%h) {} foreach with a hash is usually an error + +map { 'xxx' } %h a hash is not a valid parameter to function map + +$xxx = ('yyy', 'zzz') context tuple(string, string) is not compatible with context scalar + +@l ||= 'xxx' "||=" is only useful with a scalar + +length @l never use "length @l", it returns the length of the string int(@l) + +%h . 'yyy' context hash is not compatible with context string + +'xxx' > 'yyy' you should use a string operator, not the number operator ">" + +1 cmp 2 you should use a number operator, not the string operator "cmp" (or replace the number with a string) |