>>788
例があるじゃん。マニュアル嫁。

# then do some pattern matching with either the simple interface
$patidx = $exp->expect($timeout, @match_patterns);

# or multi-match on several spawned commands with callbacks,
# just like the Tcl version
$exp->expect($timeout,
[ qr/regex1/ => sub { my $exp = shift;
$exp->send("response\n");
exp_continue; } ],
[ "regexp2" , \&callback, @cbparms ],
);