Skip to content

Commit e16e241

Browse files
authored
Merge pull request #857 from tbrowder/io-fix
use correct funcs and methods
2 parents 6e413b8 + cf9680d commit e16e241

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/Type/IO/Handle.pod6

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,20 @@ to a file. See L<sub sprintf|https://docs.perl6.org/type/Str#sub_sprintf> for d
125125
the Perl 6 C<$format> implementation
126126
127127
Note that currently C<printf> is not a method for C<IO::Handle>, but
128-
its effect may be duplicated with a work-around using C<sub sprintf>.
129-
For example:
128+
its effect may be duplicated with a work-around using C<sub sprintf>
129+
and methods C<print> or C<say>. For example:
130130
131131
=for code :skip-test
132132
my $fh = open 'path/to/file', :w;
133-
$fh.say(printf("%d\n", 32));
133+
$fh.print(sprintf("%d\n", 32));
134134
$fh.close;
135135
136136
The C<say> method (see below) may be used for an automatic ending
137137
newline:
138138
139139
=for code :skip-test
140140
my $fh = open 'path/to/file', :w;
141-
$fh.say(printf("%d\n", 32));
141+
$fh.say(sprintf("%d", 32));
142142
$fh.close;
143143
144144
See L<sub sprintf|https://docs.perl6.org/type/Str#sub_sprintf>

0 commit comments

Comments
 (0)