File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -125,20 +125,20 @@ to a file. See L<sub sprintf|https://docs.perl6.org/type/Str#sub_sprintf> for d
125
125
the Perl 6 C < $format > implementation
126
126
127
127
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:
130
130
131
131
= for code :skip-test
132
132
my $fh = open 'path/to/file', :w;
133
- $fh.say(printf ("%d\n", 32));
133
+ $fh.print(sprintf ("%d\n", 32));
134
134
$fh.close;
135
135
136
136
The C < say > method (see below) may be used for an automatic ending
137
137
newline:
138
138
139
139
= for code :skip-test
140
140
my $fh = open 'path/to/file', :w;
141
- $fh.say(printf ("%d\n ", 32));
141
+ $fh.say(sprintf ("%d", 32));
142
142
$fh.close;
143
143
144
144
See L < sub sprintf|https://docs.perl6.org/type/Str#sub_sprintf >
You can’t perform that action at this time.
0 commit comments