Commit | Line | Data |
599cee73 |
1 | pp_sys.c AOK |
2 | |
767a6a26 |
3 | untie attempted while %d inner references still exist [pp_untie] |
599cee73 |
4 | sub TIESCALAR { bless [] } ; tie $a, 'main'; untie $a ; |
5 | |
c289d2f7 |
6 | fileno() on unopened filehandle abc [pp_fileno] |
7 | $a = "abc"; fileno($a) |
8 | |
9 | binmode() on unopened filehandle abc [pp_binmode] |
10 | $a = "abc"; fileno($a) |
11 | |
12 | printf() on unopened filehandle abc [pp_prtf] |
13 | $a = "abc"; printf $a "fred" |
14 | |
767a6a26 |
15 | Filehandle %s opened only for input [pp_leavewrite] |
599cee73 |
16 | format STDIN = |
17 | . |
18 | write STDIN; |
19 | |
9a7dcd9c |
20 | write() on closed filehandle %s [pp_leavewrite] |
599cee73 |
21 | format STDIN = |
22 | . |
23 | close STDIN; |
24 | write STDIN ; |
25 | |
767a6a26 |
26 | page overflow [pp_leavewrite] |
599cee73 |
27 | |
2dd78f96 |
28 | printf() on unopened filehandle abc [pp_prtf] |
599cee73 |
29 | $a = "abc"; printf $a "fred" |
30 | |
767a6a26 |
31 | Filehandle %s opened only for input [pp_prtf] |
599cee73 |
32 | $a = "abc"; |
33 | printf $a "fred" |
34 | |
9a7dcd9c |
35 | printf() on closed filehandle %s [pp_prtf] |
599cee73 |
36 | close STDIN ; |
37 | printf STDIN "fred" |
38 | |
69282e91 |
39 | syswrite() on closed filehandle %s [pp_send] |
599cee73 |
40 | close STDIN; |
41 | syswrite STDIN, "fred", 1; |
42 | |
69282e91 |
43 | send() on closed socket %s [pp_send] |
599cee73 |
44 | close STDIN; |
45 | send STDIN, "fred", 1 |
46 | |
69282e91 |
47 | bind() on closed socket %s [pp_bind] |
599cee73 |
48 | close STDIN; |
49 | bind STDIN, "fred" ; |
50 | |
51 | |
69282e91 |
52 | connect() on closed socket %s [pp_connect] |
599cee73 |
53 | close STDIN; |
54 | connect STDIN, "fred" ; |
55 | |
69282e91 |
56 | listen() on closed socket %s [pp_listen] |
599cee73 |
57 | close STDIN; |
58 | listen STDIN, 2; |
59 | |
69282e91 |
60 | accept() on closed socket %s [pp_accept] |
599cee73 |
61 | close STDIN; |
69282e91 |
62 | accept "fred", STDIN ; |
599cee73 |
63 | |
69282e91 |
64 | shutdown() on closed socket %s [pp_shutdown] |
599cee73 |
65 | close STDIN; |
66 | shutdown STDIN, 0; |
67 | |
69282e91 |
68 | setsockopt() on closed socket %s [pp_ssockopt] |
69 | getsockopt() on closed socket %s [pp_ssockopt] |
599cee73 |
70 | close STDIN; |
71 | setsockopt STDIN, 1,2,3; |
72 | getsockopt STDIN, 1,2; |
73 | |
69282e91 |
74 | getsockname() on closed socket %s [pp_getpeername] |
75 | getpeername() on closed socket %s [pp_getpeername] |
599cee73 |
76 | close STDIN; |
77 | getsockname STDIN; |
78 | getpeername STDIN; |
79 | |
69282e91 |
80 | flock() on closed socket %s [pp_flock] |
bc37a18f |
81 | flock() on closed socket [pp_flock] |
69282e91 |
82 | close STDIN; |
83 | flock STDIN, 8; |
bc37a18f |
84 | flock $a, 8; |
69282e91 |
85 | |
5e1c7ca2 |
86 | The stat preceding lstat() wasn't an lstat %s [pp_stat] |
9d837945 |
87 | lstat(STDIN); |
88 | |
767a6a26 |
89 | warn(warn_nl, "stat"); [pp_stat] |
599cee73 |
90 | |
2dd78f96 |
91 | -T on closed filehandle %s |
92 | stat() on closed filehandle %s |
93 | close STDIN ; -T STDIN ; stat(STDIN) ; |
599cee73 |
94 | |
767a6a26 |
95 | warn(warn_nl, "open"); [pp_fttext] |
599cee73 |
96 | -T "abc\ndef" ; |
97 | |
767a6a26 |
98 | Filehandle %s opened only for output [pp_sysread] |
99 | my $file = "./xcv" ; |
100 | open(F, ">$file") ; |
101 | my $a = sysread(F, $a,10) ; |
102 | |
599cee73 |
103 | |
104 | |
105 | __END__ |
767a6a26 |
106 | # pp_sys.c [pp_untie] |
4438c4b7 |
107 | use warnings 'untie' ; |
599cee73 |
108 | sub TIESCALAR { bless [] } ; |
109 | $b = tie $a, 'main'; |
110 | untie $a ; |
4438c4b7 |
111 | no warnings 'untie' ; |
0453d815 |
112 | $c = tie $d, 'main'; |
113 | untie $d ; |
599cee73 |
114 | EXPECT |
115 | untie attempted while 1 inner references still exist at - line 5. |
116 | ######## |
767a6a26 |
117 | # pp_sys.c [pp_leavewrite] |
4438c4b7 |
118 | use warnings 'io' ; |
599cee73 |
119 | format STDIN = |
120 | . |
121 | write STDIN; |
4438c4b7 |
122 | no warnings 'io' ; |
0453d815 |
123 | write STDIN; |
599cee73 |
124 | EXPECT |
43693395 |
125 | Filehandle STDIN opened only for input at - line 5. |
599cee73 |
126 | ######## |
767a6a26 |
127 | # pp_sys.c [pp_leavewrite] |
4438c4b7 |
128 | use warnings 'closed' ; |
599cee73 |
129 | format STDIN = |
130 | . |
131 | close STDIN; |
132 | write STDIN; |
69282e91 |
133 | opendir STDIN, "."; |
134 | write STDIN; |
135 | closedir STDIN; |
4438c4b7 |
136 | no warnings 'closed' ; |
0453d815 |
137 | write STDIN; |
69282e91 |
138 | opendir STDIN, "."; |
139 | write STDIN; |
599cee73 |
140 | EXPECT |
43693395 |
141 | write() on closed filehandle STDIN at - line 6. |
142 | write() on closed filehandle STDIN at - line 8. |
143 | (Are you trying to call write() on dirhandle STDIN?) |
599cee73 |
144 | ######## |
767a6a26 |
145 | # pp_sys.c [pp_leavewrite] |
4438c4b7 |
146 | use warnings 'io' ; |
599cee73 |
147 | format STDOUT_TOP = |
148 | abc |
149 | . |
150 | format STDOUT = |
151 | def |
152 | ghi |
153 | . |
154 | $= = 1 ; |
155 | $- =1 ; |
3eeba6fb |
156 | open STDOUT, ">".($^O eq 'VMS'? 'NL:' : '/dev/null') ; |
599cee73 |
157 | write ; |
4438c4b7 |
158 | no warnings 'io' ; |
0453d815 |
159 | write ; |
599cee73 |
160 | EXPECT |
161 | page overflow at - line 13. |
162 | ######## |
767a6a26 |
163 | # pp_sys.c [pp_prtf] |
4438c4b7 |
164 | use warnings 'unopened' ; |
599cee73 |
165 | $a = "abc"; |
0453d815 |
166 | printf $a "fred"; |
4438c4b7 |
167 | no warnings 'unopened' ; |
0453d815 |
168 | printf $a "fred"; |
599cee73 |
169 | EXPECT |
2dd78f96 |
170 | printf() on unopened filehandle abc at - line 4. |
599cee73 |
171 | ######## |
767a6a26 |
172 | # pp_sys.c [pp_prtf] |
4438c4b7 |
173 | use warnings 'closed' ; |
599cee73 |
174 | close STDIN ; |
0453d815 |
175 | printf STDIN "fred"; |
69282e91 |
176 | opendir STDIN, "."; |
177 | printf STDIN "fred"; |
178 | closedir STDIN; |
4438c4b7 |
179 | no warnings 'closed' ; |
0453d815 |
180 | printf STDIN "fred"; |
69282e91 |
181 | opendir STDIN, "."; |
182 | printf STDIN "fred"; |
599cee73 |
183 | EXPECT |
43693395 |
184 | printf() on closed filehandle STDIN at - line 4. |
185 | printf() on closed filehandle STDIN at - line 6. |
186 | (Are you trying to call printf() on dirhandle STDIN?) |
599cee73 |
187 | ######## |
767a6a26 |
188 | # pp_sys.c [pp_prtf] |
4438c4b7 |
189 | use warnings 'io' ; |
0453d815 |
190 | printf STDIN "fred"; |
4438c4b7 |
191 | no warnings 'io' ; |
0453d815 |
192 | printf STDIN "fred"; |
599cee73 |
193 | EXPECT |
43693395 |
194 | Filehandle STDIN opened only for input at - line 3. |
599cee73 |
195 | ######## |
767a6a26 |
196 | # pp_sys.c [pp_send] |
4438c4b7 |
197 | use warnings 'closed' ; |
599cee73 |
198 | close STDIN; |
199 | syswrite STDIN, "fred", 1; |
69282e91 |
200 | opendir STDIN, "."; |
201 | syswrite STDIN, "fred", 1; |
202 | closedir STDIN; |
4438c4b7 |
203 | no warnings 'closed' ; |
0453d815 |
204 | syswrite STDIN, "fred", 1; |
69282e91 |
205 | opendir STDIN, "."; |
206 | syswrite STDIN, "fred", 1; |
599cee73 |
207 | EXPECT |
43693395 |
208 | syswrite() on closed filehandle STDIN at - line 4. |
209 | syswrite() on closed filehandle STDIN at - line 6. |
210 | (Are you trying to call syswrite() on dirhandle STDIN?) |
69282e91 |
211 | ######## |
212 | # pp_sys.c [pp_flock] |
f0963acb |
213 | use Config; |
214 | BEGIN { |
9bdf8ebc |
215 | if ( !$Config{d_flock} && |
216 | !$Config{d_fcntl_can_lock} && |
217 | !$Config{d_lockf} ) { |
f0963acb |
218 | print <<EOM ; |
219 | SKIPPED |
220 | # flock not present |
221 | EOM |
222 | exit ; |
223 | } |
224 | } |
bc37a18f |
225 | use warnings qw(unopened closed); |
69282e91 |
226 | close STDIN; |
227 | flock STDIN, 8; |
228 | opendir STDIN, "."; |
229 | flock STDIN, 8; |
bc37a18f |
230 | flock FOO, 8; |
231 | flock $a, 8; |
232 | no warnings qw(unopened closed); |
69282e91 |
233 | flock STDIN, 8; |
234 | opendir STDIN, "."; |
235 | flock STDIN, 8; |
bc37a18f |
236 | flock FOO, 8; |
237 | flock $a, 8; |
69282e91 |
238 | EXPECT |
43693395 |
239 | flock() on closed filehandle STDIN at - line 16. |
c934501c |
240 | flock() on closed filehandle STDIN at - line 18. |
43693395 |
241 | (Are you trying to call flock() on dirhandle STDIN?) |
c934501c |
242 | flock() on unopened filehandle FOO at - line 19. |
243 | flock() on unopened filehandle at - line 20. |
599cee73 |
244 | ######## |
767a6a26 |
245 | # pp_sys.c [pp_prtf pp_send pp_bind pp_connect pp_listen pp_accept pp_shutdown pp_ssockopt ppp_getpeername] |
4438c4b7 |
246 | use warnings 'io' ; |
599cee73 |
247 | use Config; |
248 | BEGIN { |
249 | if ( $^O ne 'VMS' and ! $Config{d_socket}) { |
250 | print <<EOM ; |
251 | SKIPPED |
252 | # send not present |
253 | # bind not present |
254 | # connect not present |
255 | # accept not present |
256 | # shutdown not present |
257 | # setsockopt not present |
258 | # getsockopt not present |
259 | # getsockname not present |
260 | # getpeername not present |
261 | EOM |
262 | exit ; |
263 | } |
264 | } |
265 | close STDIN; |
266 | send STDIN, "fred", 1; |
267 | bind STDIN, "fred" ; |
268 | connect STDIN, "fred" ; |
269 | listen STDIN, 2; |
69282e91 |
270 | accept "fred", STDIN; |
271 | shutdown STDIN, 0; |
272 | setsockopt STDIN, 1,2,3; |
273 | getsockopt STDIN, 1,2; |
274 | getsockname STDIN; |
275 | getpeername STDIN; |
276 | opendir STDIN, "."; |
277 | send STDIN, "fred", 1; |
278 | bind STDIN, "fred" ; |
279 | connect STDIN, "fred" ; |
280 | listen STDIN, 2; |
281 | accept "fred", STDIN; |
599cee73 |
282 | shutdown STDIN, 0; |
283 | setsockopt STDIN, 1,2,3; |
284 | getsockopt STDIN, 1,2; |
285 | getsockname STDIN; |
286 | getpeername STDIN; |
69282e91 |
287 | closedir STDIN; |
4438c4b7 |
288 | no warnings 'io' ; |
0453d815 |
289 | send STDIN, "fred", 1; |
290 | bind STDIN, "fred" ; |
291 | connect STDIN, "fred" ; |
292 | listen STDIN, 2; |
293 | accept STDIN, "fred" ; |
294 | shutdown STDIN, 0; |
295 | setsockopt STDIN, 1,2,3; |
296 | getsockopt STDIN, 1,2; |
297 | getsockname STDIN; |
298 | getpeername STDIN; |
69282e91 |
299 | opendir STDIN, "."; |
300 | send STDIN, "fred", 1; |
301 | bind STDIN, "fred" ; |
302 | connect STDIN, "fred" ; |
303 | listen STDIN, 2; |
304 | accept "fred", STDIN; |
305 | shutdown STDIN, 0; |
306 | setsockopt STDIN, 1,2,3; |
307 | getsockopt STDIN, 1,2; |
308 | getsockname STDIN; |
309 | getpeername STDIN; |
599cee73 |
310 | EXPECT |
43693395 |
311 | send() on closed socket STDIN at - line 22. |
312 | bind() on closed socket STDIN at - line 23. |
313 | connect() on closed socket STDIN at - line 24. |
314 | listen() on closed socket STDIN at - line 25. |
315 | accept() on closed socket STDIN at - line 26. |
316 | shutdown() on closed socket STDIN at - line 27. |
317 | setsockopt() on closed socket STDIN at - line 28. |
318 | getsockopt() on closed socket STDIN at - line 29. |
319 | getsockname() on closed socket STDIN at - line 30. |
320 | getpeername() on closed socket STDIN at - line 31. |
321 | send() on closed socket STDIN at - line 33. |
322 | (Are you trying to call send() on dirhandle STDIN?) |
323 | bind() on closed socket STDIN at - line 34. |
324 | (Are you trying to call bind() on dirhandle STDIN?) |
325 | connect() on closed socket STDIN at - line 35. |
326 | (Are you trying to call connect() on dirhandle STDIN?) |
327 | listen() on closed socket STDIN at - line 36. |
328 | (Are you trying to call listen() on dirhandle STDIN?) |
329 | accept() on closed socket STDIN at - line 37. |
330 | (Are you trying to call accept() on dirhandle STDIN?) |
331 | shutdown() on closed socket STDIN at - line 38. |
332 | (Are you trying to call shutdown() on dirhandle STDIN?) |
333 | setsockopt() on closed socket STDIN at - line 39. |
334 | (Are you trying to call setsockopt() on dirhandle STDIN?) |
335 | getsockopt() on closed socket STDIN at - line 40. |
336 | (Are you trying to call getsockopt() on dirhandle STDIN?) |
337 | getsockname() on closed socket STDIN at - line 41. |
338 | (Are you trying to call getsockname() on dirhandle STDIN?) |
339 | getpeername() on closed socket STDIN at - line 42. |
340 | (Are you trying to call getpeername() on dirhandle STDIN?) |
599cee73 |
341 | ######## |
767a6a26 |
342 | # pp_sys.c [pp_stat] |
4438c4b7 |
343 | use warnings 'newline' ; |
599cee73 |
344 | stat "abc\ndef"; |
4438c4b7 |
345 | no warnings 'newline' ; |
0453d815 |
346 | stat "abc\ndef"; |
599cee73 |
347 | EXPECT |
348 | Unsuccessful stat on filename containing newline at - line 3. |
349 | ######## |
9d837945 |
350 | # pp_sys.c [pp_stat] |
351 | use Config; |
352 | BEGIN { |
353 | if ($^O eq 'd_lstat') { |
354 | print <<EOM ; |
355 | SKIPPED |
356 | # lstat not present |
357 | EOM |
358 | exit ; |
359 | } |
360 | } |
361 | use warnings 'io' ; |
362 | lstat(STDIN) ; |
363 | no warnings 'io' ; |
364 | lstat(STDIN) ; |
365 | EXPECT |
5e1c7ca2 |
366 | The stat preceding lstat() wasn't an lstat at - line 13. |
9d837945 |
367 | ######## |
767a6a26 |
368 | # pp_sys.c [pp_fttext] |
2dd78f96 |
369 | use warnings qw(unopened closed) ; |
599cee73 |
370 | close STDIN ; |
371 | -T STDIN ; |
9ddeeac9 |
372 | stat(STDIN) ; |
2dd78f96 |
373 | -T HOCUS; |
374 | stat(POCUS); |
375 | no warnings qw(unopened closed) ; |
0453d815 |
376 | -T STDIN ; |
9ddeeac9 |
377 | stat(STDIN); |
2dd78f96 |
378 | -T HOCUS; |
379 | stat(POCUS); |
599cee73 |
380 | EXPECT |
2dd78f96 |
381 | -T on closed filehandle STDIN at - line 4. |
382 | stat() on closed filehandle STDIN at - line 5. |
383 | -T on unopened filehandle HOCUS at - line 6. |
384 | stat() on unopened filehandle POCUS at - line 7. |
599cee73 |
385 | ######## |
767a6a26 |
386 | # pp_sys.c [pp_fttext] |
4438c4b7 |
387 | use warnings 'newline' ; |
599cee73 |
388 | -T "abc\ndef" ; |
4438c4b7 |
389 | no warnings 'newline' ; |
0453d815 |
390 | -T "abc\ndef" ; |
599cee73 |
391 | EXPECT |
392 | Unsuccessful open on filename containing newline at - line 3. |
767a6a26 |
393 | ######## |
394 | # pp_sys.c [pp_sysread] |
395 | use warnings 'io' ; |
6bbf1b34 |
396 | if ($^O eq 'dos') { |
397 | print <<EOM ; |
398 | SKIPPED |
399 | # skipped on dos |
400 | EOM |
401 | exit ; |
402 | } |
767a6a26 |
403 | my $file = "./xcv" ; |
404 | open(F, ">$file") ; |
405 | my $a = sysread(F, $a,10) ; |
406 | no warnings 'io' ; |
407 | my $a = sysread(F, $a,10) ; |
408 | close F ; |
409 | unlink $file ; |
410 | EXPECT |
c6f2523f |
411 | Filehandle F opened only for output at - line 12. |
c289d2f7 |
412 | ######## |
413 | # pp_sys.c [pp_binmode] |
414 | use warnings 'unopened' ; |
415 | binmode(BLARG); |
416 | $a = "BLERG";binmode($a); |
417 | EXPECT |
418 | binmode() on unopened filehandle BLARG at - line 3. |
419 | binmode() on unopened filehandle at - line 4. |