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