in reply to Re^2: Expect script doubt
in thread Expect script doubt

Any chance of putting the < code > < /code > tags round your code? I am afraid of missing something you put there otherwise.

One world, one people

Replies are listed 'Best First'.
Re^4: Expect script doubt
by Anonymous Monk on Jun 27, 2005 at 11:43 UTC
    <code> $exp_inst->expect($timeout, '-re' , $prompt, sub { my $fh = shift; $fh->send("$command\n"); } , timeout => sub { my_die "unable to get the prompt $prompt"; } ); sleep (2); $exp_inst->expect($timeout, qr'.*' , sub { $exp_inst->send("\n"); } , timeout => sub { print "Notting happening"; } ); <\code>
      </code> to terminate the code -- some of the code is either getting lost or is causing the problem because of a shifted actual parameter list but until I see an unscrambled version of the code I can't be sure of this.
        $exp_inst->expect($timeout, ['-re' , $prompt, sub { my $fh = shift; $fh->send("$command\n"); } ] , [ timeout => sub { my_die "unable to get the prompt $prompt"; } ); ], sleep (2); $exp_inst->expect($timeout, [ qr'.*' , sub { $exp_inst->send("\n"); } ] , [ timeout => sub { print "Notting happening"; } ] );