Index: src/pmc/filehandle.pmc =================================================================== --- src/pmc/filehandle.pmc (revision 39534) +++ src/pmc/filehandle.pmc (working copy) @@ -368,6 +368,10 @@ string_result = Parrot_str_new(INTERP, r, 0); mem_sys_free(r); } + else { + Parrot_io_set_flags(interp, SELF, + (PARROT_FILEHANDLE(SELF)->flags | PIO_F_EOF)); + } #else if (got_prompt) fprintf(stderr, "%s", prompt->strstart); Index: compilers/pct/src/PCT/HLLCompiler.pir =================================================================== --- compilers/pct/src/PCT/HLLCompiler.pir (revision 39534) +++ compilers/pct/src/PCT/HLLCompiler.pir (working copy) @@ -591,8 +591,9 @@ ## display a prompt ourselves if readline isn't present interactive_read: + $I0 = isfalse stdin # check if we've reached EOF + if $I0 goto interactive_end code = stdin.'readline_interactive'(prompt) - if null code goto interactive_end unless code goto interactive_loop concat code, "\n" push_eh interactive_trap