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

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
Re^2: Getting Call-Response Behavior with Expect
by gnosti (Friar) 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://861517]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2014-07-29 04:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls