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 | |
9a7dcd9c |
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 | |
9a7dcd9c |
33 | readline() 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] |
6bc102ca |
39 | sub fred { fred() if $a++ < 200} fred() |
599cee73 |
40 | |
767a6a26 |
41 | Deep recursion on anonymous subroutine [Perl_sub_crush_depth] |
6bc102ca |
42 | $a = sub { &$a if $a++ < 200} &$a |
599cee73 |
43 | |
6bc102ca |
44 | Possible Y2K bug: about to append an integer to '19' [pp_concat] |
45 | $x = "19$yy\n"; |
767a6a26 |
46 | |
599cee73 |
47 | __END__ |
767a6a26 |
48 | # pp_hot.c [pp_print] |
4438c4b7 |
49 | use warnings 'unopened' ; |
599cee73 |
50 | $f = $a = "abc" ; |
0453d815 |
51 | print $f $a; |
4438c4b7 |
52 | no warnings 'unopened' ; |
0453d815 |
53 | print $f $a; |
599cee73 |
54 | EXPECT |
43693395 |
55 | Filehandle abc never opened at - line 4. |
599cee73 |
56 | ######## |
767a6a26 |
57 | # pp_hot.c [pp_print] |
4438c4b7 |
58 | use warnings 'io' ; |
599cee73 |
59 | print STDIN "anc"; |
af8c498a |
60 | print <STDOUT>; |
61 | print <STDERR>; |
62 | open(FOO, ">&STDOUT") and print <FOO>; |
63 | print getc(STDERR); |
64 | print getc(FOO); |
ea1135d6 |
65 | #################################################################### |
66 | # The next test is known to fail on some systems (Linux+old glibc, # |
67 | # old *BSDs, and NeXT, among others. # |
68 | # We skip it for now (on the grounds that it is "just" a warning). # |
69 | #################################################################### |
37bd1396 |
70 | #read(FOO,$_,1); |
71 | no warnings 'io' ; |
72 | print STDIN "anc"; |
599cee73 |
73 | EXPECT |
43693395 |
74 | Filehandle STDIN opened only for input at - line 3. |
75 | Filehandle STDOUT opened only for output at - line 4. |
76 | Filehandle STDERR opened only for output at - line 5. |
77 | Filehandle FOO opened only for output at - line 6. |
78 | Filehandle STDERR opened only for output at - line 7. |
79 | Filehandle FOO opened only for output at - line 8. |
599cee73 |
80 | ######## |
767a6a26 |
81 | # pp_hot.c [pp_print] |
4438c4b7 |
82 | use warnings 'closed' ; |
599cee73 |
83 | close STDIN ; |
84 | print STDIN "anc"; |
69282e91 |
85 | opendir STDIN, "."; |
86 | print STDIN "anc"; |
87 | closedir STDIN; |
4438c4b7 |
88 | no warnings 'closed' ; |
0453d815 |
89 | print STDIN "anc"; |
69282e91 |
90 | opendir STDIN, "."; |
91 | print STDIN "anc"; |
599cee73 |
92 | EXPECT |
43693395 |
93 | print() on closed filehandle STDIN at - line 4. |
94 | print() on closed filehandle STDIN at - line 6. |
95 | (Are you trying to call print() on dirhandle STDIN?) |
599cee73 |
96 | ######## |
767a6a26 |
97 | # pp_hot.c [pp_rv2av] |
4438c4b7 |
98 | use warnings 'uninitialized' ; |
599cee73 |
99 | my $a = undef ; |
0453d815 |
100 | my @b = @$a; |
4438c4b7 |
101 | no warnings 'uninitialized' ; |
0453d815 |
102 | my @c = @$a; |
599cee73 |
103 | EXPECT |
b89fed5f |
104 | Use of uninitialized value in array dereference at - line 4. |
599cee73 |
105 | ######## |
767a6a26 |
106 | # pp_hot.c [pp_rv2hv] |
4438c4b7 |
107 | use warnings 'uninitialized' ; |
599cee73 |
108 | my $a = undef ; |
0453d815 |
109 | my %b = %$a; |
4438c4b7 |
110 | no warnings 'uninitialized' ; |
0453d815 |
111 | my %c = %$a; |
599cee73 |
112 | EXPECT |
b89fed5f |
113 | Use of uninitialized value in hash dereference at - line 4. |
599cee73 |
114 | ######## |
767a6a26 |
115 | # pp_hot.c [pp_aassign] |
e476b1b5 |
116 | use warnings 'misc' ; |
599cee73 |
117 | my %X ; %X = (1,2,3) ; |
e476b1b5 |
118 | no warnings 'misc' ; |
0453d815 |
119 | my %Y ; %Y = (1,2,3) ; |
599cee73 |
120 | EXPECT |
121 | Odd number of elements in hash assignment at - line 3. |
122 | ######## |
767a6a26 |
123 | # pp_hot.c [pp_aassign] |
e476b1b5 |
124 | use warnings 'misc' ; |
599cee73 |
125 | my %X ; %X = [1 .. 3] ; |
e476b1b5 |
126 | no warnings 'misc' ; |
0453d815 |
127 | my %Y ; %Y = [1 .. 3] ; |
599cee73 |
128 | EXPECT |
129 | Reference found where even-sized list expected at - line 3. |
130 | ######## |
767a6a26 |
131 | # pp_hot.c [Perl_do_readline] |
4438c4b7 |
132 | use warnings 'closed' ; |
69282e91 |
133 | close STDIN ; $a = <STDIN> ; |
134 | opendir STDIN, "." ; $a = <STDIN> ; |
135 | closedir STDIN; |
4438c4b7 |
136 | no warnings 'closed' ; |
69282e91 |
137 | opendir STDIN, "." ; $a = <STDIN> ; |
0453d815 |
138 | $a = <STDIN> ; |
599cee73 |
139 | EXPECT |
43693395 |
140 | readline() on closed filehandle STDIN at - line 3. |
141 | readline() on closed filehandle STDIN at - line 4. |
142 | (Are you trying to call readline() on dirhandle STDIN?) |
599cee73 |
143 | ######## |
767a6a26 |
144 | # pp_hot.c [Perl_do_readline] |
145 | use warnings 'io' ; |
146 | my $file = "./xcv" ; unlink $file ; |
147 | open (FH, ">./xcv") ; |
148 | my $a = <FH> ; |
149 | no warnings 'io' ; |
150 | $a = <FH> ; |
151 | unlink $file ; |
152 | EXPECT |
43693395 |
153 | Filehandle FH opened only for output at - line 5. |
767a6a26 |
154 | ######## |
155 | # pp_hot.c [Perl_sub_crush_depth] |
4438c4b7 |
156 | use warnings 'recursion' ; |
599cee73 |
157 | sub fred |
158 | { |
159 | fred() if $a++ < 200 |
160 | } |
4a925ff6 |
161 | { |
162 | local $SIG{__WARN__} = sub { |
163 | die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/ |
164 | }; |
165 | fred(); |
166 | } |
599cee73 |
167 | EXPECT |
4a925ff6 |
168 | ok |
599cee73 |
169 | ######## |
767a6a26 |
170 | # pp_hot.c [Perl_sub_crush_depth] |
4438c4b7 |
171 | no warnings 'recursion' ; |
0453d815 |
172 | sub fred |
173 | { |
174 | fred() if $a++ < 200 |
175 | } |
176 | { |
177 | local $SIG{__WARN__} = sub { |
178 | die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/ |
179 | }; |
180 | fred(); |
181 | } |
182 | EXPECT |
183 | |
184 | ######## |
767a6a26 |
185 | # pp_hot.c [Perl_sub_crush_depth] |
4438c4b7 |
186 | use warnings 'recursion' ; |
599cee73 |
187 | $b = sub |
188 | { |
189 | &$b if $a++ < 200 |
190 | } ; |
191 | |
192 | &$b ; |
193 | EXPECT |
194 | Deep recursion on anonymous subroutine at - line 5. |
0453d815 |
195 | ######## |
767a6a26 |
196 | # pp_hot.c [Perl_sub_crush_depth] |
4438c4b7 |
197 | no warnings 'recursion' ; |
0453d815 |
198 | $b = sub |
199 | { |
200 | &$b if $a++ < 200 |
201 | } ; |
202 | |
203 | &$b ; |
204 | EXPECT |
6bc102ca |
205 | ######## |
206 | # pp_hot.c [pp_concat] |
e476b1b5 |
207 | use warnings 'y2k'; |
6bc102ca |
208 | use Config; |
209 | BEGIN { |
210 | unless ($Config{ccflags} =~ /Y2KWARN/) { |
211 | print "SKIPPED\n# perl not built with -DPERL_Y2KWARN"; |
212 | exit 0; |
213 | } |
214 | } |
215 | my $x; |
216 | my $yy = 78; |
217 | $x = "19$yy\n"; |
218 | $x = "19" . $yy . "\n"; |
219 | $x = "319$yy\n"; |
220 | $x = "319" . $yy . "\n"; |
e476b1b5 |
221 | no warnings 'y2k'; |
6bc102ca |
222 | $x = "19$yy\n"; |
223 | $x = "19" . $yy . "\n"; |
224 | EXPECT |
225 | Possible Y2K bug: about to append an integer to '19' at - line 12. |
226 | Possible Y2K bug: about to append an integer to '19' at - line 13. |