I can't seem to find an answer anywhere to my problem. I hope there is one. This is what I am trying to do ...
I have a perl script using CGI to collect the contents of an uploaded file from a web user. I have an open file handle that is serving the input. What I want to do is re-direct that input through an external program and read back its output.
I've discovered how to use open to pipe to the standard input of an executed program OR to collect the standard output from one. I've also discovered socketpair() which I can see can be used with fork() to send/receive data to/from a parent and child process. But I cannot see how I can execute an external program and both send to its standard input and read from its standard output.
The only solution I can think of is to use a temporary file (either for the input or the output of the external program). But I'd prefer not to go this route. Is there a better way?
Can anyone help with this?
BTW: I only need to keep compatiblity with UNIX
In reply to Sending open file contents through an external program by pdac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |