On Thu, 07 Jan 2016 12:50:43 -0800, pmqs wrote:
> Given this can be used to walk though a file
>
> for $fh.lines -> $line
>
> I assumed I would be able to iterate through a file using "read" like
> this
>
> my $filename = "/tmp/readtest";
> spurt $filename, "abcdefg";
>
> my $fh = open($filenam
On Thu, 07 Jan 2016 12:50:43 -0800, pmqs wrote:
> Given this can be used to walk though a file
>
> for $fh.lines -> $line
>
> I assumed I would be able to iterate through a file using "read" like
> this
>
> my $filename = "/tmp/readtest";
> spurt $filename, "abcdefg";
>
> my $fh = open($filenam
Unless I'm missing something, there is no bug here.
Here's how each example works:
for $fh.lines -> $line { ... }
The .lines method is only called once, and returns a lazy sequence of lines
(represented as a Seq object). The `for` loop then iterates this sequence.
for $fh.read(1024) ->