http://www.perlmonks.org?node_id=574688


in reply to EOF character

You're apparently somewhat confused. EOF is just that, EOF. When you press ^D at a keyboard, it gives the application a 0-byte read, which stdio interprets as "end of file". There's nothing after that. Nothing.

So, the way to send EOF to your child process is to close the handle. That's it. And you can't do more IO after that, just as you couldn't do more IO after that if you were interacting with it anyway.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.