Commit | Line | Data |
767a6a26 |
1 | pp_hot.c |
599cee73 |
2 | |
767a6a26 |
3 | Filehandle %s never opened [pp_print] |
599cee73 |
4 | $f = $a = "abc" ; print $f $a |
5 | |
767a6a26 |
6 | Filehandle %s opened only for input [pp_print] |
599cee73 |
7 | print STDIN "abc" ; |
8 | |
767a6a26 |
9 | Filehandle %s opened only for output [pp_print] |
af8c498a |
10 | print <STDOUT> ; |
599cee73 |
11 | |
767a6a26 |
12 | print on closed filehandle %s [pp_print] |
599cee73 |
13 | close STDIN ; print STDIN "abc" ; |
14 | |
767a6a26 |
15 | uninitialized [pp_rv2av] |
599cee73 |
16 | my $a = undef ; my @b = @$a |
17 | |
767a6a26 |
18 | uninitialized [pp_rv2hv] |
599cee73 |
19 | my $a = undef ; my %b = %$a |
20 | |
767a6a26 |
21 | Odd number of elements in hash list [pp_aassign] |
599cee73 |
22 | %X = (1,2,3) ; |
23 | |
767a6a26 |
24 | Reference found where even-sized list expected [pp_aassign] |
599cee73 |
25 | $X = [ 1 ..3 ]; |
26 | |
767a6a26 |
27 | Filehandle %s opened only for output [Perl_do_readline] |
28 | open (FH, ">./xcv") ; |
29 | my $a = <FH> ; |
30 | |
31 | glob failed (can't start child: %s) [Perl_do_readline] <<TODO |
32 | |
33 | Read on closed filehandle %s [Perl_do_readline] |
599cee73 |
34 | close STDIN ; $a = <STDIN>; |
35 | |
767a6a26 |
36 | glob failed (child exited with status %d%s) [Perl_do_readline] <<TODO |
37 | |
38 | Deep recursion on subroutine \"%s\" [Perl_sub_crush_depth] |
599cee73 |
39 | sub fred { fred() if $a++ < 200} fred() |
40 | |
767a6a26 |
41 | Deep recursion on anonymous subroutine [Perl_sub_crush_depth] |
599cee73 |
42 | $a = sub { &$a if $a++ < 200} &$a |
43 | |
767a6a26 |
44 | |
599cee73 |
45 | __END__ |
767a6a26 |
46 | # pp_hot.c [pp_print] |
4438c4b7 |
47 | use warnings 'unopened' ; |
599cee73 |
48 | $f = $a = "abc" ; |
0453d815 |
49 | print $f $a; |
4438c4b7 |
50 | no warnings 'unopened' ; |
0453d815 |
51 | print $f $a; |
599cee73 |
52 | EXPECT |
53 | Filehandle main::abc never opened at - line 4. |
54 | ######## |
767a6a26 |
55 | # pp_hot.c [pp_print] |
4438c4b7 |
56 | use warnings 'io' ; |
599cee73 |
57 | print STDIN "anc"; |
af8c498a |
58 | print <STDOUT>; |
59 | print <STDERR>; |
60 | open(FOO, ">&STDOUT") and print <FOO>; |
61 | print getc(STDERR); |
62 | print getc(FOO); |
88c07c36 |
63 | #################################################################### |
37bd1396 |
64 | # The next test is known to fail on some systems (Linux/BSD+glibc, # |
65 | # NeXT among others. glibc should be fixed in the next version, # |
66 | # but it appears other platforms have little hope. We skip it for # |
67 | # now (on the grounds that it is "just" a warning). # |
88c07c36 |
68 | #################################################################### |
37bd1396 |
69 | #read(FOO,$_,1); |
70 | no warnings 'io' ; |
71 | print STDIN "anc"; |
599cee73 |
72 | EXPECT |
73 | Filehandle main::STDIN opened only for input at - line 3. |
af8c498a |
74 | Filehandle main::STDOUT opened only for output at - line 4. |
75 | Filehandle main::STDERR opened only for output at - line 5. |
76 | Filehandle main::FOO opened only for output at - line 6. |
77 | Filehandle main::STDERR opened only for output at - line 7. |
78 | Filehandle main::FOO opened only for output at - line 8. |
599cee73 |
79 | ######## |
767a6a26 |
80 | # pp_hot.c [pp_print] |
4438c4b7 |
81 | use warnings 'closed' ; |
599cee73 |
82 | close STDIN ; |
83 | print STDIN "anc"; |
4438c4b7 |
84 | no warnings 'closed' ; |
0453d815 |
85 | print STDIN "anc"; |
599cee73 |
86 | EXPECT |
87 | print on closed filehandle main::STDIN at - line 4. |
88 | ######## |
767a6a26 |
89 | # pp_hot.c [pp_rv2av] |
4438c4b7 |
90 | use warnings 'uninitialized' ; |
599cee73 |
91 | my $a = undef ; |
0453d815 |
92 | my @b = @$a; |
4438c4b7 |
93 | no warnings 'uninitialized' ; |
0453d815 |
94 | my @c = @$a; |
599cee73 |
95 | EXPECT |
96 | Use of uninitialized value at - line 4. |
97 | ######## |
767a6a26 |
98 | # pp_hot.c [pp_rv2hv] |
4438c4b7 |
99 | use warnings 'uninitialized' ; |
599cee73 |
100 | my $a = undef ; |
0453d815 |
101 | my %b = %$a; |
4438c4b7 |
102 | no warnings 'uninitialized' ; |
0453d815 |
103 | my %c = %$a; |
599cee73 |
104 | EXPECT |
105 | Use of uninitialized value at - line 4. |
106 | ######## |
767a6a26 |
107 | # pp_hot.c [pp_aassign] |
4438c4b7 |
108 | use warnings 'unsafe' ; |
599cee73 |
109 | my %X ; %X = (1,2,3) ; |
4438c4b7 |
110 | no warnings 'unsafe' ; |
0453d815 |
111 | my %Y ; %Y = (1,2,3) ; |
599cee73 |
112 | EXPECT |
113 | Odd number of elements in hash assignment at - line 3. |
114 | ######## |
767a6a26 |
115 | # pp_hot.c [pp_aassign] |
4438c4b7 |
116 | use warnings 'unsafe' ; |
599cee73 |
117 | my %X ; %X = [1 .. 3] ; |
4438c4b7 |
118 | no warnings 'unsafe' ; |
0453d815 |
119 | my %Y ; %Y = [1 .. 3] ; |
599cee73 |
120 | EXPECT |
121 | Reference found where even-sized list expected at - line 3. |
122 | ######## |
767a6a26 |
123 | # pp_hot.c [Perl_do_readline] |
4438c4b7 |
124 | use warnings 'closed' ; |
599cee73 |
125 | close STDIN ; $a = <STDIN> ; |
4438c4b7 |
126 | no warnings 'closed' ; |
0453d815 |
127 | $a = <STDIN> ; |
599cee73 |
128 | EXPECT |
af8c498a |
129 | Read on closed filehandle main::STDIN at - line 3. |
599cee73 |
130 | ######## |
767a6a26 |
131 | # pp_hot.c [Perl_do_readline] |
132 | use warnings 'io' ; |
133 | my $file = "./xcv" ; unlink $file ; |
134 | open (FH, ">./xcv") ; |
135 | my $a = <FH> ; |
136 | no warnings 'io' ; |
137 | $a = <FH> ; |
138 | unlink $file ; |
139 | EXPECT |
140 | Filehandle main::FH opened only for output at - line 5. |
141 | ######## |
142 | # pp_hot.c [Perl_sub_crush_depth] |
4438c4b7 |
143 | use warnings 'recursion' ; |
599cee73 |
144 | sub fred |
145 | { |
146 | fred() if $a++ < 200 |
147 | } |
4a925ff6 |
148 | { |
149 | local $SIG{__WARN__} = sub { |
150 | die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/ |
151 | }; |
152 | fred(); |
153 | } |
599cee73 |
154 | EXPECT |
4a925ff6 |
155 | ok |
599cee73 |
156 | ######## |
767a6a26 |
157 | # pp_hot.c [Perl_sub_crush_depth] |
4438c4b7 |
158 | no warnings 'recursion' ; |
0453d815 |
159 | sub fred |
160 | { |
161 | fred() if $a++ < 200 |
162 | } |
163 | { |
164 | local $SIG{__WARN__} = sub { |
165 | die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/ |
166 | }; |
167 | fred(); |
168 | } |
169 | EXPECT |
170 | |
171 | ######## |
767a6a26 |
172 | # pp_hot.c [Perl_sub_crush_depth] |
4438c4b7 |
173 | use warnings 'recursion' ; |
599cee73 |
174 | $b = sub |
175 | { |
176 | &$b if $a++ < 200 |
177 | } ; |
178 | |
179 | &$b ; |
180 | EXPECT |
181 | Deep recursion on anonymous subroutine at - line 5. |
0453d815 |
182 | ######## |
767a6a26 |
183 | # pp_hot.c [Perl_sub_crush_depth] |
4438c4b7 |
184 | no warnings 'recursion' ; |
0453d815 |
185 | $b = sub |
186 | { |
187 | &$b if $a++ < 200 |
188 | } ; |
189 | |
190 | &$b ; |
191 | EXPECT |
192 | |