Skip to content

Commit f7e75c1

Browse files
committed
[io grant] Document IO::Handle.nl-in
1 parent 3eaf7f2 commit f7e75c1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

doc/Type/IO/Handle.pod6

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,28 @@ This returns a value that the operating system would understand as a "file descr
530530
is suitable for passing to a native function that requires a file descriptor as an
531531
argument such as C<fcntl> or C<ioctl>.
532532
533+
=head2 method .nl-in
534+
535+
Defined as:
536+
537+
method nl-in(--> Proxy:D) is rw
538+
539+
One of the attributes that can be set via C<.new>.
540+
Defaults to C<["\x0A", "\r\n"]>
541+
Takes either a L<Str> or L<Array> of C<Str> specifying line ending(s) for this
542+
handle. If C<.chomp> attribute is set to C<True>, will strip these endings
543+
in routines that C<chomp>, such as L«C<get>|/routine/get» and
544+
L«C<lines>|/routine/lines».
545+
546+
=begin code :skip-test
547+
with 'test'.IO {
548+
.spurt: '1foo2bar3foo'; # write some data into our test file
549+
my $fh will leave {.close} = .open; # can also set .nl-in via .open arg
550+
$fh.nl-in = [<foo bar>]; # set two possible line endings to use;
551+
$fh.lines.say; # OUTPUT: ("1", "2", "3").Seq
552+
}
553+
=end code
554+
533555
=head2 method opened
534556
535557
Defined as:

0 commit comments

Comments
 (0)