Re: liens and :chomp question

2020-08-31 Thread ToddAndMargo via perl6-users
On 2020-08-30 08:16, yary wrote: Looking up https://docs.raku.org/routine/lines shows a Table of Contents with class Cool (Cool) routine lines class Supply (Supply) method lines class Str (Str) routine lines class IO::CatHandle (IO::CatHandle) method lines

Re: liens and :chomp question

2020-08-31 Thread ToddAndMargo via perl6-users
On 2020-08-30 08:16, yary wrote: Expanding on how to read the docs & signature a bit, from Tobias You confuse two methods that have the same name "lines". One of them, which exists in the IO::Path class, has a :chomp argument. The other, on IO::Handle does not.  

Re: liens and :chomp question

2020-08-30 Thread yary
Expanding on how to read the docs & signature a bit, from Tobias > You confuse two methods that have the same name "lines". One of them, > which exists in the IO::Path class, has a :chomp argument. The other, > on IO::Handle does not. > "path".IO.lines() <-- calls lines on an IO::Path

Re: liens and :chomp question

2020-08-30 Thread ToddAndMargo via perl6-users
On 2020-08-30 00:35, Tobias Boege wrote: On Sun, 30 Aug 2020, ToddAndMargo via perl6-users wrote: - You are calling .lines on the value of .IO.open which is an IO::Handle. IO::Handle.lines does not take a named argument :chomp, so passing one is useless. That explains it.

Re: liens and :chomp question

2020-08-30 Thread ToddAndMargo via perl6-users
On Sat, Aug 29, 2020 at 10:15 PM ToddAndMargo via perl6-users wrote: Hi All, I am trying to figure out how to use line with :$chomp. Now what am I doing wrong? $ alias p6 alias p6='perl6 -e' $ p6 'say "Lines.txt".IO.open.lines(:chomp)[3,2];' (Line 3 Line 2) $ p6 'say

Re: liens and :chomp question

2020-08-30 Thread Tobias Boege
On Sun, 30 Aug 2020, ToddAndMargo via perl6-users wrote: > >- You are calling .lines on the value of .IO.open which is an > > IO::Handle. IO::Handle.lines does not take a named argument > > :chomp, so passing one is useless. > > That explains it. > > Bu: >

Re: liens and :chomp question

2020-08-30 Thread ToddAndMargo via perl6-users
On 2020-08-29 23:09, Tobias Boege wrote: On Sat, 29 Aug 2020, ToddAndMargo via perl6-users wrote: Hi All, I am trying to figure out how to use line with :$chomp. Now what am I doing wrong? $ alias p6 alias p6='perl6 -e' $ p6 'say "Lines.txt".IO.open.lines(:chomp)[3,2];' (Line 3 Line 2) $

Re: liens and :chomp question

2020-08-30 Thread William Michels via perl6-users
Maybe this is what you want? ~$ raku -e 'say "test_lines.txt".IO.lines;' (Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 Line 10 Line 11) ~$ raku -e 'say "test_lines.txt".IO.lines.join("\n");' Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 Line 10 Line 11 ~$ raku

Re: liens and :chomp question

2020-08-30 Thread Tobias Boege
On Sat, 29 Aug 2020, ToddAndMargo via perl6-users wrote: > Hi All, > > I am trying to figure out how to use line with :$chomp. > Now what am I doing wrong? > > > $ alias p6 > alias p6='perl6 -e' > > $ p6 'say "Lines.txt".IO.open.lines(:chomp)[3,2];' > (Line 3 Line 2) > > $ p6 'say

liens and :chomp question

2020-08-29 Thread ToddAndMargo via perl6-users
Hi All, I am trying to figure out how to use line with :$chomp. Now what am I doing wrong? $ alias p6 alias p6='perl6 -e' $ p6 'say "Lines.txt".IO.open.lines(:chomp)[3,2];' (Line 3 Line 2) $ p6 'say "Lines.txt".IO.open.lines(:!chomp)[3,2];' (Line 3 Line 2) I am looking for Line 3 Line 2