in reply to output from an external program

Did you try reading the documentation for open?

If the filename begins with '|' , the filename is interpreted as a command to which output is to be piped, and if the filename ends with a '|' , the filename is interpreted as a command which pipes output to us.

Basically, your invented syntax is pretty much exactly what you'd need to do. You're just reading from the wrong filehandle in your while loop - you need to read from EXT.

Oh, and you got the pipe symbol at the wrong end of the command.

Update: Ignore me. I misread the question and didn't see the requirement to both read from and write to the filehandle. See IPC::Open3 (which is a standard module) as Zaxo suggests below.

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg