# New Ticket Created by vividsnow # Please include the string: [perl #130086] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=130086 >
Hello It is expected to be able to pass multiple eof-s (by pressing Ctrl+D). working p5 script: multiple-eof.pl and two variants of p6 scripts, which falls to endless loop after first "eof". Rakudo version 2016.10 built on MoarVM version 2016.10 implementing Perl 6.c.
use strict; while () { while (<>) { print } print "got eof\n" if eof; }
loop { if $*IN.eof { say 'try reopen'; $*IN = open($*IN.path, :r); } my $s = $*IN.Supply; react { whenever $s -> $buf { print $buf; LAST { say 'got eof'; } } } }
loop { for $*IN.lines -> $line { say $line }; say 'got eof' if $*IN.eof; }