$exp_inst->log_file("$templog", "w"); $exp_inst->expect($timeout, [ '-re' , $prompt, sub { my $fh = shift; $fh->send("$command\n"); } ], [ timeout => sub { my_die "unable to get the prompt $prompt"; } ] );