[perl #127204] [IO] for $fh.read(1024) -> $blob

2017-10-04 Thread Zoffix Znet via RT
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

[perl #127204] [IO] for $fh.read(1024) -> $blob

2017-10-04 Thread Zoffix Znet via RT
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

[perl #127204] [IO] for $fh.read(1024) -> $blob

2016-09-21 Thread Sam S. via RT
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) ->