|
From: Sorrell, A. <Al_...@tr...> - 2002-02-27 20:26:53
|
Solaris 2.6 Expect 1.12
In all the examples, when a timeout is encountered you simply die();
In my case, a device can get into a state where what is returned is
unpredictable. There is a specific sequence that I can then send to log out
the previous action and get back to a known state.
However, the code below doesn't seem to work correctly
$exp->expect($timeout,
['OVL111', sub { my $fh = shift; $fh->send("login\n"); }],
['\.', sub { my $fh = shift; $fh->send("****\nlogo\n");exp_continue;
}],
[timeout => sub { my $fh = shift;
$fh->send("****\nlogo\n");exp_continue; }]
);
Using a regex of '.*' would be another way - but risky - especially until I
can get "raw" working. Any suggestions?
Thanks,
Al
|