6
6
7
7
role IO { }
8
8
9
- The IO role provides no functionality itself, and moreso just marks if a
9
+ The IO role provides no functionality itself; it simply marks that a
10
10
particular object relates to input/output.
11
11
12
12
= head1 Routines
@@ -105,9 +105,9 @@ module|http://perldoc.perl.org/Data/Dumper.html>.
105
105
106
106
sub prompt($msg)
107
107
108
- Prints C < $msg > to the standard output and waits
109
- for the user to type in something and finish with an ENTER.
110
- Returns the string typed in without the trailing newline.
108
+ Prints C < $msg > to standard output and waits for the user to type something
109
+ and finish with an ENTER. Returns the string typed in without the trailing
110
+ newline.
111
111
112
112
my $name = prompt("Hi, what's your name? ");
113
113
@@ -116,8 +116,8 @@ Returns the string typed in without the trailing newline.
116
116
my $fh = open(IO::Path() $path, :$r, :$w, :$a, :$rw,
117
117
:$bin, :$enc, :$nl, :$chomp)
118
118
119
- Opens the C < $path > (by default in text mode) with the
120
- given options, returning an L < IO::Handle > object.
119
+ Opens the C < $path > (by default in text mode) with the given options,
120
+ returning an L < IO::Handle > object.
121
121
122
122
= head3 File mode options
123
123
@@ -179,7 +179,7 @@ is C<False>, implying text semantics.
179
179
180
180
= item text mode encoding, C < :enc >
181
181
182
- Encoding to use if opened in text mode.
182
+ The encoding to use if opened in text mode.
183
183
184
184
# open explicitly as utf8
185
185
my $fh = open("path/to/file", enc => "utf8");
@@ -242,13 +242,13 @@ contents are actually written to the file.
242
242
243
243
sub dir(Cool $path = '.', Mu :$test = none('.', '..'))
244
244
245
- Returns a list of L < IO::File > and L < IO::Path > objects for the
246
- files and directories found in the $path. If $path is not given
247
- assumes the current directory.
245
+ Returns a list of L < IO::File > and L < IO::Path > objects for the files and
246
+ directories found in the C < $path > . If C < $path > is not given assumes the
247
+ current directory.
248
248
249
- A second optional parameter can be given that will be
250
- matched against the strings to filter out certain entries.
251
- By default it filters out the '.' and '..' entries.
249
+ A second optional parameter can be given that will be matched against the
250
+ strings to filter out certain entries. By default it filters out the '.'
251
+ and '..' entries.
252
252
253
253
Examples:
254
254
@@ -262,7 +262,7 @@ To include all the entries (including . and ..) write:
262
262
263
263
dir(test => all())
264
264
265
- To include only entries with a .pl extension write:
265
+ To include only entries with a C < .pl > extension write:
266
266
267
267
dir(test => /.pl$/)
268
268
@@ -296,7 +296,7 @@ either be a string or an C<IO::Path> object). To write to an C<IO::Handle>,
296
296
use the L < print > method.
297
297
298
298
If a file needs to be opened for writing, it will also be C < close > d. Returns
299
- True on success, or the appropriate C < Failure > if something went wrong.
299
+ C < True > on success, or the appropriate C < Failure > if something went wrong.
300
300
301
301
These named parameters are optional and only have meaning if the first
302
302
positional parameter was B < not > an C < IO::Handle > :
@@ -376,7 +376,7 @@ other shenanigans. See L<shell|/type/IO#sub_shell> if you want that.
376
376
sub shell($cmd) returns Proc::Status:D
377
377
378
378
Runs a command through the system shell. All shell meta characters are
379
- interpreted by the shell, inluding pipes, redirects, environment variable
379
+ interpreted by the shell, including pipes, redirects, environment variable
380
380
substitutions and so on. See L < run|/type/IO#sub_run > if you don't want that.
381
381
382
382
The return value is of L < type Proc::Status|/type/Proc::Status > .
0 commit comments