# New Ticket Created by  Paul Marquess 
# Please include the string:  [perl #127204]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=127204 >


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($filename, :r, :bin);

for $fh.read(1024) -> $block { say $block }

Actual output is


97
98
99
100
101
102
103

Alternative is to use 

while $fh.read(1024) -> $block { say $block }


IRC Dialog

<TimToady> I think used to force a binary interpretation of a filehandle, but 
maybe that broke
<TimToady> *read used to

<TimToady> m: for ($*IN.read(1024),) -> $block { say $block.WHAT }
<camelia> rakudo-moar ed6ec7: OUTPUT«(Buf[uint8])␤»
<TimToady> it's calling .list on the buf

Reply via email to