File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -273,22 +273,17 @@ mode is undefined.
273
273
274
274
Defined as:
275
275
276
- multi method comb(IO::Handle:D: :$close = False)
277
- multi method comb(IO::Handle:D: Int:D $size, :$close = False)
278
- multi method comb(IO::Handle:D: $comber, :$close = False)
276
+ method comb(IO::Handle:D: :$close, |c)
279
277
280
- Returns a lazy list of strings combed from the handle, just like C < comb >
281
- on strings.
282
-
283
- = for code :skip-test
284
- my $fh = open 'path/to/file', :r;
285
- $fn.comb(/A+/); # Comb file contents by a regex.
286
-
287
- or
278
+ L < Slurps|/routine/slurp > the handle's content and calls
279
+ L « C < Str.split > |/type/Str#routine_comb» on it, forwarding any of the given
280
+ arguments. If C < :$close > named parameter is set to C < True > , will
281
+ L < close > the invocant after slurping. It is an error to call this method on
282
+ a handle opened in binary mode.
288
283
289
284
= for code :skip-test
290
- my $fh = open 'path/to/file', :r ;
291
- $fn.comb(3, close => True); # Comb file contents by 3 characters and close after.
285
+ my $fh = 'path/to/file'.IO.open ;
286
+ say "The file has {+$fh.comb: '♥', :$close} ♥s in it";
292
287
293
288
= head2 method print
294
289
You can’t perform that action at this time.
0 commit comments