in reply to Inter-process communication when using Expect.pm

expect.pm says that the object returned by the new method is really an IO::Pty object. You should be able to use this like any other IO::Handle within IO::Select. If you are not familiar with select, then you have some reading to do.

You can then get your 'new commands' from anything with base type IO::Handle, while at the same time monitoring what your expect session is doing. CAVEAT - I have not actually tried this (although I'm sure ikegami will undoubtedly 10min after I post this and tell me I'm wrong :)), and I'm not sure what select will return if you are using an expect call with a timeout and it times out. It may say 'readable' or 'exception'. You will have to experiment.

fnord

  • Comment on Re: Inter-process communication when using Expect.pm