File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ for 'huge-csv'.IO.lines -> $line {
44
44
# Do something with $line
45
45
}
46
46
47
- # or if you'll be processing later
48
- my @lines = 'huge-csv'.IO.lines;
47
+ # or if you'll be processing later
48
+ my @lines = 'huge-csv'.IO.lines;
49
49
50
50
= head1 Writing to files
51
51
@@ -126,10 +126,10 @@ if "path/to/file".IO ~~ :e {
126
126
say 'file exists';
127
127
}
128
128
129
- my $file = "path/to/file";
130
- if $file.IO ~~ :e {
131
- say 'file exists';
132
- }
129
+ my $file = "path/to/file";
130
+ if $file.IO ~~ :e {
131
+ say 'file exists';
132
+ }
133
133
134
134
Similarly to the file existence check, one can also check to see if a path
135
135
is a directory. For instance, assuming that the file C < testfile > and the
@@ -172,18 +172,18 @@ To create a new directory, simply call the C<mkdir> function with the
172
172
directory name as its argument:
173
173
174
174
= for code :skip-test
175
- mkdir "newdir";
175
+ mkdir "newdir";
176
176
177
177
The function returns the name of the created directory on success and C < Nil >
178
178
on failure. Thus the standard Perl idiom works as expected:
179
179
180
180
= for code :skip-test
181
- mkdir "newdir" or die "$!";
181
+ mkdir "newdir" or die "$!";
182
182
183
183
Use C < rmdir > to remove I < empty > directories:
184
184
185
185
= for code :skip-test
186
- rmdir "newdir" or die "$!";
186
+ rmdir "newdir" or die "$!";
187
187
188
188
= end pod
189
189
You can’t perform that action at this time.
0 commit comments