in reply to Process command output after each input
use strict; use Expect; ... # This sample code is adapted from the Expect man page, # and is not tested. my $exp = Expect->spawn($command, @params) or die "Cannot spawn $command: $!\n"; $exp->send("string\n"); my ($matched_pattern_position, $error, $successfully_matching_string, $before_match, $after_match) = $exp->expect($timeout, @match_patterns);
|
|---|