in reply to Best way to communicate with a shell like process?

On further thought, I think the key issue is that I wish to run this program and then "take over" it's stdin/stdout, so the perl script can read/write to them instead of the console it provides.
  • Comment on Re: Best way to communicate with a shell like process?

Replies are listed 'Best First'.
Re: Re: Best way to communicate with a shell like process?
by NetWallah (Canon) on Aug 24, 2003 at 15:16 UTC
    Yes - that is what the IPC::Open's do.

    Basically, they start the process (server in your case), then redirect the STDIN and STDOUT such that they go through your perl script. You get full control of content in and out.

    It is not clear from your post whether the "server" script is started separately. The IPC::Opens require that the perl script start the "server" program.

    Also, you use the therm "console" loosely. Most likely, you are referring the the STDIN, STDOUT and STDERR of the "server" script. Please use this terminology for future posting. The "Console" referrs to the window (or terminal) in which the script runs. Hence, you can REDIRECT the STDOUT to the console, and receive STDIN from the console, but they are not to be confused with the console itself.