@@ -143,9 +143,10 @@ X<note()>
143
143
144
144
sub note(*@text --> Bool)
145
145
146
- Print the given text, followed by a new line C<"\n"> on C<$*ERR>. Before
147
- printing, call the C<.gist> method on any non-C<Str> objects. Return whether
148
- successful. It really just is like L</say()>, but on C<$*ERR>.
146
+ Print the given text, followed by a new line (as determined by the
147
+ C<"nl-saying"> attribute on C<$*ERR>. Before printing, call the C<.gist>
148
+ method on any non-C<Str> objects. Return whether successful. It really just
149
+ is like L</say()>, but on C<$*ERR>, except that a bare call will say "Noted".
149
150
150
151
=head2 open()
151
152
X<open()>
@@ -160,8 +161,9 @@ X<open()>
160
161
Bool :$bin = False,
161
162
Str :$enc = "Unicode", # utf-8 unless otherwise
162
163
# newlines
163
- Any :$nl = "EOL",
164
- Bool :$chomp = True,
164
+ Any :$nl-reading = "EOL",
165
+ Any :$nl-saying = "\n",
166
+ Bool :$chomp = True,
165
167
--> IO::Handle )
166
168
167
169
A convenience function for opening normal files as text (by default) as
@@ -204,13 +206,18 @@ figuring out which actual UTF is in use, either from a BOM or other heuristics.
204
206
If heuristics are inconclusive, UTF-8 will be assumed. (No 8-bit encoding will
205
207
ever be picked implicitly.)
206
208
207
- =item :nl
209
+ =item :nl-reading
208
210
209
211
The marker used to indicate the end of a line of text. Only used in text
210
212
mode. Defaults to "EOL", which implies accepting any combination of C<"\n">,
211
213
C<"\r\n"> or C<"\r"> or any other Unicode character that has the C<Zl>
212
214
(Separator, Line) property.
213
215
216
+ =item :nl-saying
217
+
218
+ The end of a line of text marker used when C<say>ing on this handle. Defaults
219
+ to C<"\n">.
220
+
214
221
=item :chomp
215
222
216
223
Whether or not to remove new line characters from text obtained with
@@ -238,9 +245,9 @@ X<say()>
238
245
239
246
sub say(*@text --> Bool)
240
247
241
- Print the given text, followed by a new line C<"\n"> on C<$*OUT>. Before
242
- printing, call the C<.gist> method on any non-C<Str> objects . Return whether
243
- successful.
248
+ Print the given text, followed by a new line (as determined by the
249
+ C<"nl-saying"> attribute on C<$*OUT> . Before printing, call the C<.gist>
250
+ method on any non-C<Str> objects. Return whether successful.
244
251
245
252
=head2 slurp()
246
253
X<slurp()>
@@ -1205,8 +1212,8 @@ X<.get>
1205
1212
method get(--> Str)
1206
1213
1207
1214
Reads the next line and returns it. Uses the (implicit) specification of
1208
- C<:nl> with L</open> to determine where a line ends. Returns a C<Str> type
1209
- object if no more lines to be read.
1215
+ C<:nl-reading > with L</open> to determine where a line ends. Returns a C<Str>
1216
+ type object if no more lines to be read.
1210
1217
1211
1218
=head3 .getc
1212
1219
X<.getc>
0 commit comments