Commit | Line | Data |
599cee73 |
1 | pp.c TODO |
2 | |
3 | substr outside of string |
e476b1b5 |
4 | $a = "ab" ; $b = substr($a, 4,5) ; |
599cee73 |
5 | |
6 | Attempt to use reference as lvalue in substr |
7 | $a = "ab" ; $b = \$a ; substr($b, 1,1) = $b |
8 | |
9 | uninitialized in pp_rv2gv() |
10 | my *b = *{ undef()} |
11 | |
12 | uninitialized in pp_rv2sv() |
13 | my $a = undef ; my $b = $$a |
14 | |
15 | Odd number of elements in hash list |
16 | my $a = { 1,2,3 } ; |
17 | |
18 | Invalid type in unpack: '%c |
19 | my $A = pack ("A,A", 1,2) ; |
20 | my @A = unpack ("A,A", "22") ; |
21 | |
22 | Attempt to pack pointer to temporary value |
23 | pack("p", "abc") ; |
24 | |
25 | Explicit blessing to '' (assuming package main) |
26 | bless \[], ""; |
27 | |
0453d815 |
28 | Constant subroutine %s undefined <<<TODO |
29 | Constant subroutine (anonymous) undefined <<<TODO |
30 | |
599cee73 |
31 | __END__ |
32 | # pp.c |
4438c4b7 |
33 | use warnings 'substr' ; |
599cee73 |
34 | $a = "ab" ; |
e476b1b5 |
35 | $b = substr($a, 4,5) ; |
4438c4b7 |
36 | no warnings 'substr' ; |
0453d815 |
37 | $a = "ab" ; |
e476b1b5 |
38 | $b = substr($a, 4,5) ; |
599cee73 |
39 | EXPECT |
40 | substr outside of string at - line 4. |
41 | ######## |
42 | # pp.c |
4438c4b7 |
43 | use warnings 'substr' ; |
599cee73 |
44 | $a = "ab" ; |
45 | $b = \$a ; |
46 | substr($b, 1,1) = "ab" ; |
4438c4b7 |
47 | no warnings 'substr' ; |
0453d815 |
48 | substr($b, 1,1) = "ab" ; |
599cee73 |
49 | EXPECT |
50 | Attempt to use reference as lvalue in substr at - line 5. |
51 | ######## |
52 | # pp.c |
4438c4b7 |
53 | use warnings 'uninitialized' ; |
599cee73 |
54 | # TODO |
55 | EXPECT |
56 | |
57 | ######## |
58 | # pp.c |
e476b1b5 |
59 | use warnings 'misc' ; |
599cee73 |
60 | my $a = { 1,2,3}; |
e476b1b5 |
61 | no warnings 'misc' ; |
0453d815 |
62 | my $b = { 1,2,3}; |
599cee73 |
63 | EXPECT |
64 | Odd number of elements in hash assignment at - line 3. |
65 | ######## |
66 | # pp.c |
e476b1b5 |
67 | use warnings 'pack' ; |
68 | use warnings 'unpack' ; |
599cee73 |
69 | my @a = unpack ("A,A", "22") ; |
70 | my $a = pack ("A,A", 1,2) ; |
e476b1b5 |
71 | no warnings 'pack' ; |
72 | no warnings 'unpack' ; |
0453d815 |
73 | my @b = unpack ("A,A", "22") ; |
74 | my $b = pack ("A,A", 1,2) ; |
599cee73 |
75 | EXPECT |
e476b1b5 |
76 | Invalid type in unpack: ',' at - line 4. |
77 | Invalid type in pack: ',' at - line 5. |
599cee73 |
78 | ######## |
79 | # pp.c |
4438c4b7 |
80 | use warnings 'uninitialized' ; |
599cee73 |
81 | my $a = undef ; |
0453d815 |
82 | my $b = $$a; |
4438c4b7 |
83 | no warnings 'uninitialized' ; |
0453d815 |
84 | my $c = $$a; |
599cee73 |
85 | EXPECT |
b89fed5f |
86 | Use of uninitialized value in scalar dereference at - line 4. |
599cee73 |
87 | ######## |
88 | # pp.c |
e476b1b5 |
89 | use warnings 'pack' ; |
599cee73 |
90 | sub foo { my $a = "a"; return $a . $a++ . $a++ } |
91 | my $a = pack("p", &foo) ; |
e476b1b5 |
92 | no warnings 'pack' ; |
0453d815 |
93 | my $b = pack("p", &foo) ; |
599cee73 |
94 | EXPECT |
95 | Attempt to pack pointer to temporary value at - line 4. |
96 | ######## |
97 | # pp.c |
e476b1b5 |
98 | use warnings 'misc' ; |
599cee73 |
99 | bless \[], "" ; |
e476b1b5 |
100 | no warnings 'misc' ; |
0453d815 |
101 | bless \[], "" ; |
599cee73 |
102 | EXPECT |
103 | Explicit blessing to '' (assuming package main) at - line 3. |
0453d815 |
104 | ######## |
105 | # pp.c |
106 | use utf8 ; |
107 | $_ = "\x80 \xff" ; |
108 | reverse ; |
109 | EXPECT |
0453d815 |
110 | ######## |