$index=0; my $inputfile="perloutput"; my $endfile=".txt "; my $smb="> "; my $outputfile="output"; my $smb2="&"; while ($index<2) { my $testpath="chirp_md5sum "; $testpath=$testpath.$inputfile.$index.$endfile.$smb.$outputfile.$index.$endfile.$smb2; chomp $testpath; print ("$testpath \n"); $id=fork(); if ($id == 0) { exec($testpath) or die "unable to exec $testpath: $!\n"; } $index++; } while (wait > -1) {};