Hi All,
I am trying to open multiple processes in a Perl script on Windows. Program structure would look some thing like this...
my($chld1_out, $chld1_in);
my($chld2_out, $chld2_in);
my($chld3_out, $chld3_in);
my @cmds1=();
my @cmds2=();
my @cmds3=();
$pid1 = open2($chld1_out, $chld1_in, 'ex1.exe')or die $!;
$pid2 = open2($chld2_out, $chld2_in, 'ex2.pl')or die $!;
$pid3 = open2($chld3_out, $chld3_in, 'ex3.exe')or die $!;
print $chld1_in $cmds1[0];
print $chld2_in $cmds2[0];
$op1=<$chld1_out>;
$op2=<$chld2_out>;
if ( $op1 == 'done' && $op1 != 'done')
print $chld1_in $cmds1[0];
elsif ( $op1 != 'done' && $op1 == 'done')
print $chld2_in $cmds2[0];
elsif ( $op1 == 'done' && $op1 == 'done')
print $chld1_in $cmds1[1];
print $chld2_in $cmds2[1];
.....
.....
for loops and while loops..... to process with the data output... and do conditional programming.
close $pid1 or die $!;
close $pid2 or die $!;
close $pid3 or die $!;
If it does how can I execute the Perl script ( ex2.pl ) one way i know is system($^X,"ex2.pl","arg") ;
I would appreciate fro your help on this ASAP...
Thanks,
-Abishek