Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Getting Call-Response Behavior with Expect

by Proclus (Beadle)
on Sep 23, 2010 at 11:58 UTC ( #861517=note: print w/replies, xml ) Need Help??

in reply to Getting Call-Response Behavior with Expect

Obviously you have invested some time on Expect so I do not want to steer you to a different solution but just to keep in mind, POE offers excellent solutions to these kind of problems.

You can have a look at POE::Wheel::Run . It will allow you to register callbacks for STDIN and STDOUT so that you can talk to your process in a nonblocking fashion.
  • Comment on Re: Getting Call-Response Behavior with Expect

Replies are listed 'Best First'.
Re^2: Getting Call-Response Behavior with Expect
by gnosti (Hermit) on Sep 23, 2010 at 14:50 UTC
    Long enough to be discouraged by its approach. If anything, I'm more inclined to look elsewhere. I'd thought that Expect was a well-established way to address this problem space.

    My application does use an event framework already. I have AnyEvent, with Event or Tk underneath, depending on if the user starts the app in GUI mode.

    I'm not especially keen to switch out event frameworks in order to do a little IO with a command-line utility extending my app. But I will investigate POE.

      In addition to your comments, POE::Wheel::Run may give you hard time in a GUI environment esp on Windows.
      I haven't used AnyEvent myself, but I've seen that it can be used with POE.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://861517]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2018-05-21 02:04 GMT
Find Nodes?
    Voting Booth?