summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/test/context.t
blob: 081abcc9823fab33c4bd0d0d276ceb224a976130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
foreach (%h) {}                          context hash is not compatible with context list
                                         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'                            context string is not compatible with context float
                                         context string is not compatible with context float
                                         

1 cmp 2                                  you should use a number operator, not the string operator "cmp" (or replace the number with a string)

$xxx == undef                            context undef is not compatible with context float

my ($xxx) = 1                            context int is not compatible with context tuple(scalar)

($xxx, $yyy) = 1                         context int is not compatible with context tuple(scalar, scalar)

($xxx, $yyy) = (1, 2, 3)                 context tuple(int, int, int) is not compatible with context tuple(scalar, scalar)

@l eq '3'                                context array is not compatible with context string

qw(a b) > 2                              context tuple(string, string) is not compatible with context float

%h > 0                                   context hash is not compatible with context float

%h eq 0                                  context hash is not compatible with context string
                                         you should use a number operator, not the string operator "eq" (or replace the number with a string)

@l == ()

$xxx = { xxx() }->{xxx};

$xxx = { xxx() }->{$xxx};
a>25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/loglevel.c b/src/loglevel.c
deleted file mode 100644
index de2a4e11..00000000
--- a/src/loglevel.c
+++ /dev/null
@@ -1,25 +0,0 @@
-
-/* Change the default console loglevel */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <linux/unistd.h>
-#include <sys/syscall.h>
-
-int main(int argc, char **argv) {
- int level;
-
- if (!argv[1]) exit(0);
- level=atoi(argv[1]);
- if ( (level<1) || (level>8) ) {
- fprintf(stderr,"invalid log level %d\n",level);
- exit(-1);
- }
- if (!syscall(SYS_syslog,8,NULL,level)) {
- exit(0);
- } else {
- perror("syslog");
- exit(-1);
- }
-}