use warnings; use strict; use Expect; my $command = 'path-to-executable'; my $exp = Expect->new(); $exp->raw_pty(1); $exp->spawn($command) or die "Cannot spawn $command: $!\n"; $exp->send("1\n"); $exp->send("myInputFile.txt\n"); $exp->soft_close();
In reply to Re: Calling and interacting with external executable
by toolic
in thread Calling and interacting with external executable
by verity
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |