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