Skip to content

Commit 396015f

Browse files
authored
Document behaviour on .out-buffer changes
and add a code example
1 parent f984462 commit 396015f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/Type/IO/Handle.pod6

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,18 @@ Lastly, can take a C<Nil> to enable TTY-based buffering control: if
493493
the handle L<is a TTY|/routine/t>, the buffering is disabled, otherwise,
494494
default, implementation-defined buffer size is used.
495495
496+
See L<flush> to write out data currently in the buffer. Changing buffer
497+
size flushes the filehandle.
498+
499+
=for code :skip-test
500+
given 'foo'.IO.open: :w, :1000out-buffer {
501+
.say: 'Hello world!'; # buffered
502+
.out-buffer = 42; # buffer resized; previous print flushed
503+
.say: 'And goodbye';
504+
.close; # closing the handle flushes the buffer
505+
}
506+
507+
496508
=head2 method put
497509
498510
Defined as:

0 commit comments

Comments
 (0)