laoboss has asked for the wisdom of the Perl Monks concerning the following question:
This script worked fine. But I needed to store the $in $out and $handle variables for further use. So I put them in the hashuse IPC::Run qw(start pump finish); my @args; push @args, $app_path; my ($in, $out, $err); # starting the application my $handle = start \@args, \$in, \$out, \$err; # wait until prompted for input pump $handle until $out =~ /Login:/; $in .= "Boris\n"; # wait until prompted for password pump $handle until $out =~ /Password:/; # and so on ...
But after that I had problems: From other sub I got $in $ out and $handle$client_descr->{"Handle"} = $handle; $client_descr->{"In"} = $in; $client_descr->{"Out"} = $out; $client_descr->{"Err"} = $err;
But I had problems - here in this pump loop nothing seemed to happed. This pump loop was just locked.my ($handle, $in, $out) = ($client_descr->{"Handle"}, $client_descr->{ +"In"}, $client_descr->{"Out"});
Is it true, that I can use IPC::Run only in one module? And are there any other solutions of my problem? I tried to ise Open2, but it doesn't seem to be working.$in .= "new data\n"; pump $handle until $out =~ /data arrived:/; print $out;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problems with IPC::Run module on Windows XP
by shmem (Chancellor) on Mar 31, 2007 at 21:18 UTC | |
by laoboss (Initiate) on Apr 02, 2007 at 20:20 UTC |