in reply to Re: Re: How to store the output of the process in my own array?
in thread How to store the output of the process in my own array?

Well, from my experimenting with Expect it looks like the subroutine for logging the output is called when $object->expect is called, or even when $object->expect finds a match. Probably also when it's buffer becomes full, but you realy don't want to count on that.

My suggestion is to put in some $object->expect calls that match on whatever prompt you are getting in your input stream.

  • Comment on Re: Re: Re: How to store the output of the process in my own array?

Replies are listed 'Best First'.
Re: Re: Re: Re: How to store the output of the process in my own array?
by seanborland (Initiate) on Mar 01, 2004 at 13:46 UTC
    Thank you very much. Another veteran tells me another method. It looks like follow code: my @array; ... @array=$session->expect(...); ... I put print @array after each call on the expect, and it works. It is strange because as far as I know, if under list context, the return value of the expect is not the content that output of the command line.