gnangia has asked for the wisdom of the Perl Monks concerning the following question:
The issue I seem to be having is that the while loop continues regardless of the response. It works fine with the correct password but if I use the wrong password, then it continues and reports failure at the wrong step. Please help.while($perform_step > 0) { if ($tcp_transx_param{$row_ref->[$i]}{$perform_step}) { logtext "Value of step is $perform_step"; logtext "Sending =>$tcp_transx_param{$row_ref->[$i]}{$perform_ +step}{send}<="; $session->send("$tcp_transx_param{$row_ref->[$i]}{$perform_ste +p}{send}\r"); $session->expect($expect_timeout, '-re', "$tcp_transx_param{$r +ow_ref->[$i]}{$perform_step}{expect}") || warn "Did not match at step + $perform_step for CollectionID $row_ref->[$i]" . $session -> exp_err +or(); logtext "Expecting =>$tcp_transx_param{$row_ref->[$i]}{$perfor +m_step}{expect}<="; if ($session->exp_error()) { logtext "ERROR=>" . $session->exp_error(); logtext "Closing Session"; $session->hard_close(); last; } else { $perform_step++; } } else { $perform_step=0; $session->soft_close(); last; } logtext "Increasing my step to $perform_step"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help using Expect.pm
by gnangia (Scribe) on Dec 03, 2002 at 23:15 UTC | |
by bbfu (Curate) on Dec 04, 2002 at 01:27 UTC | |
by gnangia (Scribe) on Dec 04, 2002 at 16:14 UTC |