in reply to I want to run a script from another script, use the same version of perl, and reroute IO to a terminal-like textbox

G'day ric00015,

Welcome to the monastery.

For capturing STDOUT and STDERR, take a look at Capture::Tiny. It's SEE ALSO section lists many other similar modules which may be of interest.

To get a filehandle to STDIN, consider open with '|-' mode.

Look at Tk::fileevent to create non-blocking read/write callbacks for your filehandles.

perlipc provides other options for inter-process communications.

-- Ken

  • Comment on Re: I want to run a script from another script, use the same version of perl, and reroute IO to a terminal-like textbox
  • Download Code

Replies are listed 'Best First'.
Re^2: I want to run a script from another script, use the same version of perl, and reroute IO to a terminal-like textbox
by ric00015 (Beadle) on Oct 01, 2013 at 15:54 UTC

    Thanks for the welcome.

    Good ideas. Capture::Tiny isn't what I need because I may need to write to the child (asking for y/n sort of thing), but IO::Tee might be what I need. It seems simple, and allows for bi-directional communication. The only problem might be if it starts the child process. I need to be able to pass in the hash, and I'm not sure how to do that outside of 'do'.

    Same with your other suggestions. I need to be able to pass in the hash, as well as capture the output, and send some input.