in reply to Open3 and sending single characters

You could output a "y\n" to the program using the open3 "writer" handle. This only works if the program expects input from STDIN.

Replies are listed 'Best First'.
Re: Re: Open3
by Eradicatore (Monk) on Nov 20, 2002 at 20:13 UTC
    Thanks! I guess I should have been a little more specific. I want to be able to deal with a few cases like this, and update the GUI based on the different few possible cases like this. Is there a way to do something like what I'm doing above, where I deal with each line from the program, if the program doesn't end every single line with a carriage return like in this case?

    I guess I wasn't all the worried about being able to get a yes or no answer to the program. I was more worried about processing these lines that don't end in carriage return. My loop then turns infinite...

    Justin Eltoft

      I think that you will need to resort to reading char by char to achieve your aims. There is a little information regarding this in the documentation for perlfunc:getc which in turn refers you to the module Term::Readkey. This ought to work under Win NT/2K/XP as MS claim posix complience for the CLI's on these systems. If your on an earlier Win then you have less chance.

      Good luck.


      Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
      Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
      Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
      Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.