Skip to content

Commit 70a80ec

Browse files
committed
[io grant] Document IO::Handle.put
1 parent 373c60b commit 70a80ec

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

doc/Type/IO/Handle.pod6

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,25 @@ my $fh = open 'path/to/file', :w;
352352
$fh.printf: "The value is %d\n", 32;
353353
$fh.close;
354354
355+
=head2 method put
356+
357+
Defined as:
358+
359+
multi method put(**@text --> True)
360+
361+
Writes the given C<@text> to the handle, coercing any non-L<Str> objects
362+
to L<Str> by calling L«C<.Str>|/routine/Str» method on them, and appending the
363+
value of L«C<.nl-out>|/type/IO::Handle#method_nl-out» at the end.
364+
365+
Attempting to call this method when the handle is
366+
L<in binary mode|/type/IO::Handle#method_encoding> will result in
367+
C<X::IO::BinaryMode> exception being thrown.
368+
369+
=for code :skip-test
370+
my $fh = 'path/to/file'.IO.open: :w;
371+
$fh.print: 'some text';
372+
$fh.close;
373+
355374
=head2 method say
356375
357376
Defined as:

0 commit comments

Comments
 (0)