Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 8:13 PM, ToddAndMargo via perl6-users wrote: On 10/7/18 8:11 PM, Brandon Allbery wrote: Use the read method instead. I did say in my previous message that .read is for bytes, .readchars is for graphemes (UTF8 characters plus any modifiers). On Sun, Oct 7, 2018 at 11:03 PM

Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 8:11 PM, Brandon Allbery wrote: Use the read method instead. I did say in my previous message that .read is for bytes, .readchars is for graphemes (UTF8 characters plus any modifiers). On Sun, Oct 7, 2018 at 11:03 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>>

Re: slurp so many?

2018-10-07 Thread Brandon Allbery
Use the read method instead. I did say in my previous message that .read is for bytes, .readchars is for graphemes (UTF8 characters plus any modifiers). On Sun, Oct 7, 2018 at 11:03 PM ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > On 10/7/18 7:58 PM, ToddAndMargo via perl6-users

Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 7:58 PM, ToddAndMargo via perl6-users wrote: On 10/7/18 7:54 PM, ToddAndMargo via perl6-users wrote: On 10/7/18 4:53 PM, Curt Tilmes wrote: On Sun, Oct 7, 2018 at 7:42 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote:     I use `slurp` all the time, so of

Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 7:54 PM, ToddAndMargo via perl6-users wrote: On 10/7/18 4:53 PM, Curt Tilmes wrote: On Sun, Oct 7, 2018 at 7:42 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote:     I use `slurp` all the time, so of course, I can't     make heads or tails out of    

Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 4:52 PM, Brandon Allbery wrote: The whole point of slurp is (possibly lazily in the future) reading everything. I was just hoping for 1002 ways of doing tings. If you want to read by bytes, it's the read method; by lines, it's get; for extended characters / graphemes, it's

Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 4:53 PM, Curt Tilmes wrote: On Sun, Oct 7, 2018 at 7:42 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: I use `slurp` all the time, so of course, I can't make heads or tails out of https://docs.perl6.org/routine/slurp I want to slurp the

Re: slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
On 10/7/18 5:47 PM, Brad Gilbert wrote: I think the easiest way to get a 400 characters from a file is with .comb() on the file. 'example.txt'.IO.comb(400).head() On Sun, Oct 7, 2018 at 6:42 PM ToddAndMargo via perl6-users wrote: Hi All, I use `slurp` all the time, so of course, I can't

Re: slurp so many?

2018-10-07 Thread Brad Gilbert
I think the easiest way to get a 400 characters from a file is with .comb() on the file. 'example.txt'.IO.comb(400).head() On Sun, Oct 7, 2018 at 6:42 PM ToddAndMargo via perl6-users wrote: > > Hi All, > > I use `slurp` all the time, so of course, I can't > make heads or tails out of > >

Re: slurp so many?

2018-10-07 Thread Curt Tilmes
On Sun, Oct 7, 2018 at 7:42 PM ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > I use `slurp` all the time, so of course, I can't > make heads or tails out of > > https://docs.perl6.org/routine/slurp > > I want to slurp the first 400 characters of > a file and close the handle.

Re: slurp so many?

2018-10-07 Thread Brandon Allbery
The whole point of slurp is (possibly lazily in the future) reading everything. If you want to read by bytes, it's the read method; by lines, it's get; for extended characters / graphemes, it's readchars. They all have rather different intents. On Sun, Oct 7, 2018 at 7:42 PM ToddAndMargo via

slurp so many?

2018-10-07 Thread ToddAndMargo via perl6-users
Hi All, I use `slurp` all the time, so of course, I can't make heads or tails out of https://docs.perl6.org/routine/slurp I want to slurp the first 400 characters of a file and close the handle. Am I missing a `so many` parameter somewhere? Many thanks, -T