autoquote barewords followed by newline and arrow properly
[p5sagit/p5-mst-13.2.git] / t / pragma / warn / doio
1   doio.c        
2
3   Can't open bidirectional pipe         [Perl_do_open9]
4     open(F, "| true |");
5
6   Missing command in piped open         [Perl_do_open9]
7     open(F, "| ");
8
9   Missing command in piped open         [Perl_do_open9]
10     open(F, " |");
11
12   warn(warn_nl, "open");                [Perl_do_open9]
13     open(F, "true\ncd")
14
15   Close on unopened file <%s>           [Perl_do_close] <<TODO
16     $a = "fred";close("$a")
17
18   tell() on unopened file               [Perl_do_tell]
19     $a = "fred";$a = tell($a)
20
21   seek() on unopened file               [Perl_do_seek]
22     $a = "fred";$a = seek($a,1,1)
23
24   sysseek() on unopened file            [Perl_do_sysseek]
25     $a = "fred";$a = seek($a,1,1)
26
27   warn(warn_uninit);                    [Perl_do_print]
28     print $a ;
29
30   Stat on unopened file <%s>            [Perl_my_stat]
31     close STDIN ; -x STDIN ;
32
33   warn(warn_nl, "stat");                [Perl_my_stat]
34     stat "ab\ncd"
35
36   warn(warn_nl, "lstat");               [Perl_my_lstat]
37     lstat "ab\ncd"
38
39   Can't exec \"%s\": %s                 [Perl_do_aexec5]
40
41   Can't exec \"%s\": %s                 [Perl_do_exec3]
42
43   Filehandle %s opened only for output  [Perl_do_eof]
44         my $a = eof STDOUT
45
46   Mandatory Warnings ALL TODO
47   ------------------
48   Can't do inplace edit: %s is not a regular file       [Perl_nextargv]
49      edit a directory
50
51   Can't do inplace edit: %s would not be unique         [Perl_nextargv]
52   Can't rename %s to %s: %s, skipping file              [Perl_nextargv]
53   Can't rename %s to %s: %s, skipping file              [Perl_nextargv]
54   Can't remove %s: %s, skipping file                    [Perl_nextargv]
55   Can't do inplace edit on %s: %s                       [Perl_nextargv]
56   
57
58 __END__
59 # doio.c [Perl_do_open9]
60 use warnings 'io' ;
61 open(F, '|'.($^O eq 'VMS' ? 'mcr ':'')."$^X -e 1|");
62 close(F);
63 no warnings 'io' ;
64 open(G, '|'.($^O eq 'VMS' ? 'mcr ':'')."$^X -e 1|");
65 close(G);
66 EXPECT
67 Can't open bidirectional pipe at - line 3.
68 ########
69 # doio.c [Perl_do_open9]
70 use warnings 'io' ;
71 open(F, "|      ");
72 no warnings 'io' ;
73 open(G, "|      ");
74 EXPECT
75 Missing command in piped open at - line 3.
76 ########
77 # doio.c [Perl_do_open9]
78 use warnings 'io' ;
79 open(F, "      |");
80 no warnings 'io' ;
81 open(G, "      |");
82 EXPECT
83 Missing command in piped open at - line 3.
84 ########
85 # doio.c [Perl_do_open9]
86 use warnings 'io' ;
87 open(F, "<true\ncd");
88 no warnings 'io' ;
89 open(G, "<true\ncd");
90 EXPECT
91 Unsuccessful open on filename containing newline at - line 3.
92 ########
93 # doio.c [Perl_do_close] <<TODO
94 use warnings 'unopened' ;
95 close "fred" ;
96 no warnings 'unopened' ;
97 close "joe" ;
98 EXPECT
99 Close on unopened file <fred> at - line 3.
100 ########
101 # doio.c [Perl_do_tell Perl_do_seek Perl_do_sysseek Perl_my_stat]
102 use warnings 'io' ;
103 close STDIN ;
104 tell(STDIN);
105 $a = seek(STDIN,1,1);
106 $a = sysseek(STDIN,1,1);
107 -x STDIN ;
108 no warnings 'io' ;
109 close STDIN ;
110 tell(STDIN);
111 $a = seek(STDIN,1,1);
112 $a = sysseek(STDIN,1,1);
113 -x STDIN ;
114 EXPECT
115 tell() on unopened file at - line 4.
116 seek() on unopened file at - line 5.
117 sysseek() on unopened file at - line 6.
118 Stat on unopened file <STDIN> at - line 7.
119 ########
120 # doio.c [Perl_do_print]
121 use warnings 'uninitialized' ;
122 print $a ;
123 no warnings 'uninitialized' ;
124 print $b ;
125 EXPECT
126 Use of uninitialized value in print at - line 3.
127 ########
128 # doio.c [Perl_my_stat Perl_my_lstat]
129 use warnings 'io' ;
130 stat "ab\ncd";
131 lstat "ab\ncd";
132 no warnings 'io' ;
133 stat "ab\ncd";
134 lstat "ab\ncd";
135 EXPECT
136 Unsuccessful stat on filename containing newline at - line 3.
137 Unsuccessful stat on filename containing newline at - line 4.
138 ########
139 # doio.c [Perl_do_aexec5]
140 use warnings 'io' ;
141 exec "lskdjfalksdjfdjfkls","" ;
142 no warnings 'io' ;
143 exec "lskdjfalksdjfdjfkls","" ;
144 EXPECT
145 OPTION regex
146 Can't exec "lskdjfalksdjfdjfkls": .+
147 ########
148 # doio.c [Perl_do_exec3]
149 use warnings 'io' ;
150 exec "lskdjfalksdjfdjfkls", "abc" ;
151 no warnings 'io' ;
152 exec "lskdjfalksdjfdjfkls", "abc" ;
153 EXPECT
154 OPTION regex
155 Can't exec "lskdjfalksdjfdjfkls(:? abc)?": .+
156 ########
157 # doio.c [Perl_nextargv]
158 $^W = 0 ;
159 my $filename = "./temp.dir" ;
160 mkdir $filename, 0777 
161   or die "Cannot create directory $filename: $!\n" ;
162 {
163     local (@ARGV) = ($filename) ;
164     local ($^I) = "" ;
165     my $x = <> ;
166 }
167 {
168     no warnings 'inplace' ;
169     local (@ARGV) = ($filename) ;
170     local ($^I) = "" ;
171     my $x = <> ;
172 }
173 {
174     use warnings 'inplace' ;
175     local (@ARGV) = ($filename) ;
176     local ($^I) = "" ;
177     my $x = <> ;
178 }
179 rmdir $filename ;
180 EXPECT
181 Can't do inplace edit: ./temp.dir is not a regular file at - line 9.
182 Can't do inplace edit: ./temp.dir is not a regular file at - line 21.
183
184 ########
185 # doio.c [Perl_do_eof]
186 use warnings 'io' ;
187 my $a = eof STDOUT ;
188 no warnings 'io' ;
189 $a = eof STDOUT ;
190 EXPECT
191 Filehandle main::STDOUT opened only for output at - line 3.