Hi All,

https://docs.raku.org/type/IO::Path#method_lines

method lines(IO::Path:D: :$chomp = True, :$enc = 'utf8', :$nl-in = ["\x0A", "\r\n"], |c --> Seq:D)

How do I change what lines sees as a new line.  Is it
:$nl-in?  A tab in this case.

Some of my missteps:

$ p6 'my $x="a\tb\tc\td\t"; dd $x; for $x.lines(:!chomp, "\t") {dd $_};'
Str $x = "a\tb\tc\td\t"


$ p6 'my $x="a\tb\tc\td\t"; dd $x; for $x.lines(:!chomp, :$nl-in = ["\x0A", "\r\n"]) {dd $_};'
===SORRY!=== Error while compiling -e
Variable '$nl-in' is not declared
at -e:1
------> tc\td\t"; dd $x; for $x.lines(:!chomp, :⏏$nl-in = ["\x0A", "\r\n"]) {dd $_};

$ p6 'my $x="a\tb\tc\td\t"; dd $x; for $x.lines(:!chomp, :nl-in = ["\x0A", "\r\n"]) {dd $_};'
Str $x = "a\tb\tc\td\t"
Cannot modify an immutable Pair (nl-in => True)
  in block <unit> at -e line 1


Many thanks,
-T

Reply via email to