Commit | Line | Data |
767a6a26 |
1 | doio.c |
599cee73 |
2 | |
9a7dcd9c |
3 | Can't open bidirectional pipe [Perl_do_open9] |
599cee73 |
4 | open(F, "| true |"); |
5 | |
767a6a26 |
6 | Missing command in piped open [Perl_do_open9] |
06eaf0bc |
7 | open(F, "| "); |
8 | |
767a6a26 |
9 | Missing command in piped open [Perl_do_open9] |
06eaf0bc |
10 | open(F, " |"); |
11 | |
767a6a26 |
12 | warn(warn_nl, "open"); [Perl_do_open9] |
599cee73 |
13 | open(F, "true\ncd") |
14 | |
2dd78f96 |
15 | close() on unopened filehandle %s [Perl_do_close] |
767a6a26 |
16 | $a = "fred";close("$a") |
599cee73 |
17 | |
2dd78f96 |
18 | tell() on closed filehandle [Perl_do_tell] |
599cee73 |
19 | $a = "fred";$a = tell($a) |
20 | |
2dd78f96 |
21 | seek() on closed filehandle [Perl_do_seek] |
599cee73 |
22 | $a = "fred";$a = seek($a,1,1) |
23 | |
2dd78f96 |
24 | sysseek() on closed filehandle [Perl_do_sysseek] |
599cee73 |
25 | $a = "fred";$a = seek($a,1,1) |
26 | |
767a6a26 |
27 | warn(warn_uninit); [Perl_do_print] |
599cee73 |
28 | print $a ; |
29 | |
2dd78f96 |
30 | -x on closed filehandle %s [Perl_my_stat] |
599cee73 |
31 | close STDIN ; -x STDIN ; |
32 | |
767a6a26 |
33 | warn(warn_nl, "stat"); [Perl_my_stat] |
599cee73 |
34 | stat "ab\ncd" |
35 | |
767a6a26 |
36 | warn(warn_nl, "lstat"); [Perl_my_lstat] |
599cee73 |
37 | lstat "ab\ncd" |
38 | |
5d3e98de |
39 | Use of -l on filehandle %s [Perl_my_lstat] |
40 | |
767a6a26 |
41 | Can't exec \"%s\": %s [Perl_do_aexec5] |
599cee73 |
42 | |
767a6a26 |
43 | Can't exec \"%s\": %s [Perl_do_exec3] |
599cee73 |
44 | |
767a6a26 |
45 | Filehandle %s opened only for output [Perl_do_eof] |
46 | my $a = eof STDOUT |
599cee73 |
47 | |
0453d815 |
48 | Mandatory Warnings ALL TODO |
49 | ------------------ |
767a6a26 |
50 | Can't do inplace edit: %s is not a regular file [Perl_nextargv] |
0453d815 |
51 | edit a directory |
52 | |
767a6a26 |
53 | Can't do inplace edit: %s would not be unique [Perl_nextargv] |
54 | Can't rename %s to %s: %s, skipping file [Perl_nextargv] |
55 | Can't rename %s to %s: %s, skipping file [Perl_nextargv] |
56 | Can't remove %s: %s, skipping file [Perl_nextargv] |
57 | Can't do inplace edit on %s: %s [Perl_nextargv] |
0453d815 |
58 | |
59 | |
599cee73 |
60 | __END__ |
767a6a26 |
61 | # doio.c [Perl_do_open9] |
4438c4b7 |
62 | use warnings 'io' ; |
3eeba6fb |
63 | open(F, '|'.($^O eq 'VMS' ? 'mcr ':'')."$^X -e 1|"); |
64 | close(F); |
4438c4b7 |
65 | no warnings 'io' ; |
0453d815 |
66 | open(G, '|'.($^O eq 'VMS' ? 'mcr ':'')."$^X -e 1|"); |
67 | close(G); |
599cee73 |
68 | EXPECT |
9a7dcd9c |
69 | Can't open bidirectional pipe at - line 3. |
599cee73 |
70 | ######## |
767a6a26 |
71 | # doio.c [Perl_do_open9] |
4438c4b7 |
72 | use warnings 'io' ; |
0453d815 |
73 | open(F, "| "); |
4438c4b7 |
74 | no warnings 'io' ; |
0453d815 |
75 | open(G, "| "); |
06eaf0bc |
76 | EXPECT |
77 | Missing command in piped open at - line 3. |
78 | ######## |
767a6a26 |
79 | # doio.c [Perl_do_open9] |
4438c4b7 |
80 | use warnings 'io' ; |
0453d815 |
81 | open(F, " |"); |
4438c4b7 |
82 | no warnings 'io' ; |
0453d815 |
83 | open(G, " |"); |
06eaf0bc |
84 | EXPECT |
85 | Missing command in piped open at - line 3. |
86 | ######## |
767a6a26 |
87 | # doio.c [Perl_do_open9] |
4438c4b7 |
88 | use warnings 'io' ; |
0453d815 |
89 | open(F, "<true\ncd"); |
4438c4b7 |
90 | no warnings 'io' ; |
0453d815 |
91 | open(G, "<true\ncd"); |
599cee73 |
92 | EXPECT |
93 | Unsuccessful open on filename containing newline at - line 3. |
94 | ######## |
767a6a26 |
95 | # doio.c [Perl_do_close] <<TODO |
96 | use warnings 'unopened' ; |
97 | close "fred" ; |
98 | no warnings 'unopened' ; |
99 | close "joe" ; |
100 | EXPECT |
9ddeeac9 |
101 | close() on unopened filehandle fred at - line 3. |
767a6a26 |
102 | ######## |
103 | # doio.c [Perl_do_tell Perl_do_seek Perl_do_sysseek Perl_my_stat] |
4438c4b7 |
104 | use warnings 'io' ; |
599cee73 |
105 | close STDIN ; |
106 | tell(STDIN); |
107 | $a = seek(STDIN,1,1); |
108 | $a = sysseek(STDIN,1,1); |
109 | -x STDIN ; |
9ddeeac9 |
110 | stat(STDIN) ; |
2dd78f96 |
111 | $a = "fred"; |
112 | tell($a); |
113 | seek($a,1,1); |
114 | sysseek($a,1,1); |
115 | -x $a; # ok |
116 | stat($a); # ok |
4438c4b7 |
117 | no warnings 'io' ; |
0453d815 |
118 | close STDIN ; |
119 | tell(STDIN); |
120 | $a = seek(STDIN,1,1); |
121 | $a = sysseek(STDIN,1,1); |
122 | -x STDIN ; |
9ddeeac9 |
123 | stat(STDIN) ; |
2dd78f96 |
124 | $a = "fred"; |
125 | tell($a); |
126 | seek($a,1,1); |
127 | sysseek($a,1,1); |
128 | -x $a; |
129 | stat($a); |
599cee73 |
130 | EXPECT |
2dd78f96 |
131 | tell() on closed filehandle STDIN at - line 4. |
132 | seek() on closed filehandle STDIN at - line 5. |
133 | sysseek() on closed filehandle STDIN at - line 6. |
134 | -x on closed filehandle STDIN at - line 7. |
135 | stat() on closed filehandle STDIN at - line 8. |
136 | tell() on unopened filehandle at - line 10. |
137 | seek() on unopened filehandle at - line 11. |
138 | sysseek() on unopened filehandle at - line 12. |
599cee73 |
139 | ######## |
767a6a26 |
140 | # doio.c [Perl_do_print] |
4438c4b7 |
141 | use warnings 'uninitialized' ; |
599cee73 |
142 | print $a ; |
4438c4b7 |
143 | no warnings 'uninitialized' ; |
0453d815 |
144 | print $b ; |
599cee73 |
145 | EXPECT |
b89fed5f |
146 | Use of uninitialized value in print at - line 3. |
599cee73 |
147 | ######## |
767a6a26 |
148 | # doio.c [Perl_my_stat Perl_my_lstat] |
4438c4b7 |
149 | use warnings 'io' ; |
599cee73 |
150 | stat "ab\ncd"; |
151 | lstat "ab\ncd"; |
4438c4b7 |
152 | no warnings 'io' ; |
0453d815 |
153 | stat "ab\ncd"; |
154 | lstat "ab\ncd"; |
599cee73 |
155 | EXPECT |
156 | Unsuccessful stat on filename containing newline at - line 3. |
157 | Unsuccessful stat on filename containing newline at - line 4. |
158 | ######## |
5d3e98de |
159 | # doio.c [Perl_my_stat] |
160 | use warnings 'io'; |
161 | -l STDIN; |
162 | -l $fh; |
163 | open $fh, $0 or die "# $!"; |
164 | -l $fh; |
165 | no warnings 'io'; |
166 | -l STDIN; |
167 | -l $fh; |
168 | close $fh; |
169 | EXPECT |
170 | Use of -l on filehandle STDIN at - line 3. |
171 | Use of -l on filehandle $fh at - line 6. |
172 | ######## |
767a6a26 |
173 | # doio.c [Perl_do_aexec5] |
e69a2255 |
174 | BEGIN { |
175 | if ($^O eq 'MacOS') { |
176 | print <<EOM; |
177 | SKIPPED |
178 | # no exec on Mac OS |
179 | EOM |
180 | exit; |
181 | } |
182 | } |
4438c4b7 |
183 | use warnings 'io' ; |
dfe13c55 |
184 | exec "lskdjfalksdjfdjfkls","" ; |
4438c4b7 |
185 | no warnings 'io' ; |
0453d815 |
186 | exec "lskdjfalksdjfdjfkls","" ; |
599cee73 |
187 | EXPECT |
e5e1b98b |
188 | OPTION regex |
c4f6c246 |
189 | Can't exec "lskdjfalksdjfdjfkls": .+ |
599cee73 |
190 | ######## |
767a6a26 |
191 | # doio.c [Perl_do_exec3] |
e69a2255 |
192 | BEGIN { |
193 | if ($^O eq 'MacOS') { |
194 | print <<EOM; |
195 | SKIPPED |
196 | # no exec on Mac OS |
197 | EOM |
198 | exit; |
199 | } |
200 | } |
4438c4b7 |
201 | use warnings 'io' ; |
599cee73 |
202 | exec "lskdjfalksdjfdjfkls", "abc" ; |
4438c4b7 |
203 | no warnings 'io' ; |
0453d815 |
204 | exec "lskdjfalksdjfdjfkls", "abc" ; |
599cee73 |
205 | EXPECT |
e5e1b98b |
206 | OPTION regex |
3eeba6fb |
207 | Can't exec "lskdjfalksdjfdjfkls(:? abc)?": .+ |
0453d815 |
208 | ######## |
0698c26b |
209 | # doio.c [win32_execvp] |
e69a2255 |
210 | BEGIN { |
211 | if ($^O eq 'MacOS') { |
212 | print <<EOM; |
213 | SKIPPED |
214 | # no exec on Mac OS |
215 | EOM |
216 | exit; |
217 | } |
218 | } |
0698c26b |
219 | use warnings 'exec' ; |
220 | exec $^X, "-e0" ; |
221 | EXPECT |
222 | ######## |
767a6a26 |
223 | # doio.c [Perl_nextargv] |
0453d815 |
224 | $^W = 0 ; |
ccc2aad8 |
225 | my $filename = "./temp.dir" ; |
0453d815 |
226 | mkdir $filename, 0777 |
227 | or die "Cannot create directory $filename: $!\n" ; |
228 | { |
229 | local (@ARGV) = ($filename) ; |
230 | local ($^I) = "" ; |
231 | my $x = <> ; |
232 | } |
233 | { |
4438c4b7 |
234 | no warnings 'inplace' ; |
0453d815 |
235 | local (@ARGV) = ($filename) ; |
236 | local ($^I) = "" ; |
237 | my $x = <> ; |
238 | } |
239 | { |
4438c4b7 |
240 | use warnings 'inplace' ; |
0453d815 |
241 | local (@ARGV) = ($filename) ; |
242 | local ($^I) = "" ; |
243 | my $x = <> ; |
244 | } |
245 | rmdir $filename ; |
246 | EXPECT |
ccc2aad8 |
247 | Can't do inplace edit: ./temp.dir is not a regular file at - line 9. |
248 | Can't do inplace edit: ./temp.dir is not a regular file at - line 21. |
0453d815 |
249 | |
767a6a26 |
250 | ######## |
251 | # doio.c [Perl_do_eof] |
252 | use warnings 'io' ; |
253 | my $a = eof STDOUT ; |
254 | no warnings 'io' ; |
255 | $a = eof STDOUT ; |
256 | EXPECT |
43693395 |
257 | Filehandle STDOUT opened only for output at - line 3. |
9a869a14 |
258 | ######## |
259 | # doio.c [Perl_do_openn] |
260 | use Config; |
261 | BEGIN { |
262 | if ($Config{useperlio}) { |
263 | print <<EOM; |
264 | SKIPPED |
265 | # warns only without perlio |
266 | EOM |
267 | exit; |
268 | } |
269 | } |
270 | use warnings 'io'; |
271 | my $x = "foo"; |
272 | open FOO, '>', \$x; |
35066d42 |
273 | open BAR, '>&', \*STDOUT; # should not warn |
9a869a14 |
274 | no warnings 'io'; |
275 | open FOO, '>', \$x; |
276 | EXPECT |
277 | Can't open a reference at - line 14. |