Hello,
Perhaps someone can help me. I'd like to determine which spawn_id matched,
and print the match in an expect loop that is listening to multiple
processes. For example, something like this, where \@sessions represents a
collection of spawn_id's:
expect($timeout,
'-i', \@sessions,
'-re', "([^\r\n]+)[\r\n]+", sub {
# print the match..
exp_continue;
}
);
Albeit a simple example, is there a proper way with multiple processes to
reference ($object->matchlist)[0], since I'm not sure which \@sessions
spawn_id matched? In short, I'm not sure what $object should be in this
case. I probably overlooked something in the Perldoc. Works great on
single process; i.e., ($object->matchlist)[0] prints all the matches,
assuming $object represents the spawn_id.
thanks in advance,
David Basham
|