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