Web lists-archives.com

[PHP] Re: expect_expectl: how to show the part of the stream that it is matching against

Aziz Saleh <azizsaleh <at> gmail.com> writes:

> If you want what is coming from the server, you would store the results of
> expect_expectl in a variable and output it. Unless you mean something else
> by the buffer!

AFAICS there is no way to store the result as there is no result per se.

There is only the $match variable which is empty if there was no match.

Also, defining a wildcard match in $cases proves unsuccessful as you can't
order thoses cases, meaning if you simply put a "*" match there that you'd
think would act as a fallback, then it always matches that and none of the
other patterns anymore.

Furthermore, in the "default" case of the switch statement, the $match
variable doesn't seem to be populated at all.

Finally, it doesn't seem to perform the pattern lookup line by line,
otherwise the default case would be hit way more often in my case.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php