Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I tried something like:my $cmd = Expect->spawn("program $params") or die "Couldn't run program"; unless($cmd->expect(2, "Password")) { print $cmd "passwd\n"; } #Here I would like to gather the output for parsing.
but $output comes out empty.$cmd->expect($timeot); $output = $cmd->before();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Automate program interaction
by lin0 (Curate) on Mar 09, 2007 at 22:54 UTC | |
|
Re: Automate program interaction
by TOD (Friar) on Mar 10, 2007 at 11:32 UTC |