:nl-in is a named parameter that defines what the method lines would
consider as line endings.
It defines  "\x0A", "\r\n" as the default.

Example:
 % echo "Hi, Frank." > test.txt ; echo "What's up?" >> test.txt ; echo
'"test.txt".IO.lines(:nl-in<a>).say' > test.pl6 ; perl6 ./test.pl6
(Hi, Fr nk.
Wh t's up?
)

|c slurps the remaining arguments into c and passese those arguments to the
lines method of IO::Handle.

On Fri, Aug 28, 2020 at 9:18 PM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> Hi All,
>
> In the following:
>
>     https://docs.raku.org/type/IO::Path#method_lines
>
>     (IO::Path) method lines
>
>     Defined as:
>
>     method lines(IO::Path:D: :$chomp = True, :$enc = 'utf8', :$nl-in =
> ["\x0A", "\r\n"], |c --> Seq:D)
>
>     Opens the invocant and returns its lines.
>
>     The behavior is equivalent to opening the file specified
>     by the invocant, forwarding the :$chomp, :$enc,
>     and :$nl-in arguments to IO::Handle.open, then calling
>     IO::Handle.lines on that handle, forwarding any of the
>     remaining arguments to that method, and returning the
>     resultant Seq.
>
> What exactly is and how exactly do you use `:$nl-in`
>
> And if I am not pushing it, what is `|c`?
>
> I am confused,
> -T
>


-- 
__________________

:(){ :|:& };:

Reply via email to